mirror of
https://git.proxmox.com/git/pve-kernel-meta
synced 2025-04-30 17:57:11 +00:00
proxmox-boot: return empty if file does not exist in get_first_line
makes using this helper shorter in most cases Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com> Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Tested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b9e1485fb2
commit
151a54703c
@ -104,6 +104,11 @@ loop_esp_list() {
|
|||||||
|
|
||||||
get_first_line() {
|
get_first_line() {
|
||||||
file="$1"
|
file="$1"
|
||||||
|
if [ ! -e "$file" ]; then
|
||||||
|
echo ""
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
while IFS= read -r line || [ -n "$line" ]; do
|
||||||
break
|
break
|
||||||
done < "${file}"
|
done < "${file}"
|
||||||
|
Loading…
Reference in New Issue
Block a user