From 1a920427a6300361e78a2c7675a145b94ce9e60c Mon Sep 17 00:00:00 2001 From: oddlama Date: Wed, 27 Oct 2021 13:07:55 +0200 Subject: [PATCH] fix: test for DISK_ID_EFI and DISK_ID_BIOS variable existence before expansion (fixes #15) --- scripts/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 300f499..b73dc3c 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -32,9 +32,9 @@ function check_config() { [[ $HOSTNAME =~ $hostname_regex ]] \ || die "'$HOSTNAME' is not a valid hostname" - [[ -n $DISK_ID_ROOT ]] \ + [[ -v "DISK_ID_ROOT" && -n $DISK_ID_ROOT ]] \ || die "You must assign DISK_ID_ROOT" - [[ -n $DISK_ID_EFI ]] || [[ -n $DISK_ID_BIOS ]] \ + [[ -v "DISK_ID_EFI" && -n $DISK_ID_EFI ]] || [[ -v "DISK_ID_BIOS" && -n $DISK_ID_BIOS ]] \ || die "You must assign DISK_ID_EFI or DISK_ID_BIOS" [[ -v "DISK_ID_BIOS" ]] && [[ ! -v "DISK_ID_TO_UUID[$DISK_ID_BIOS]" ]] \