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:
Stoiko Ivanov 2022-02-11 16:15:41 +01:00 committed by Thomas Lamprecht
parent b9e1485fb2
commit 151a54703c

View File

@ -104,6 +104,11 @@ loop_esp_list() {
get_first_line() {
file="$1"
if [ ! -e "$file" ]; then
echo ""
return
fi
while IFS= read -r line || [ -n "$line" ]; do
break
done < "${file}"