From 25adbb0b6889418c0cf9fc1ed2d7e93dab8e32da Mon Sep 17 00:00:00 2001 From: oddlama Date: Tue, 21 Apr 2020 18:59:49 +0200 Subject: [PATCH] Fixed missing conjunction; move preprocess_config into main.sh --- scripts/config.sh | 5 ----- scripts/functions.sh | 8 ++++---- scripts/main.sh | 2 ++ scripts/utils.sh | 3 ++- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/config.sh b/scripts/config.sh index 98c8f40..3b852a6 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -80,8 +80,3 @@ ANSIBLE_SSH_AUTHORIZED_KEYS="" # To prove that you have read and edited the config # properly, set the following value to true. I_HAVE_READ_AND_EDITED_THE_CONFIG_PROPERLY=false - - -################################################ -# DO NOT EDIT -preprocess_config diff --git a/scripts/functions.sh b/scripts/functions.sh index efbc912..4cc3482 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -35,13 +35,13 @@ check_config() { || die "You must assign DISK_ID_EFI or DISK_ID_BOOT" [[ -v "DISK_ID_BOOT" ]] && [[ -v "DISK_ID_TO_UUID[$DISK_ID_BOOT]" ]] \ - die "Missing uuid for DISK_ID_BOOT, have you made sure it is used?" + || die "Missing uuid for DISK_ID_BOOT, have you made sure it is used?" [[ -v "DISK_ID_EFI" ]] && [[ -v "DISK_ID_TO_UUID[$DISK_ID_EFI]" ]] \ - die "Missing uuid for DISK_ID_EFI, have you made sure it is used?" + || die "Missing uuid for DISK_ID_EFI, have you made sure it is used?" [[ -v "DISK_ID_SWAP" ]] && [[ -v "DISK_ID_TO_UUID[$DISK_ID_SWAP]" ]] \ - die "Missing uuid for DISK_ID_SWAP, have you made sure it is used?" + || die "Missing uuid for DISK_ID_SWAP, have you made sure it is used?" [[ -v "DISK_ID_ROOT" ]] && [[ -v "DISK_ID_TO_UUID[$DISK_ID_ROOT]" ]] \ - die "Missing uuid for DISK_ID_ROOT, have you made sure it is used?" + || die "Missing uuid for DISK_ID_ROOT, have you made sure it is used?" if [[ $INSTALL_ANSIBLE == true ]]; then [[ $INSTALL_SSHD == true ]] \ diff --git a/scripts/main.sh b/scripts/main.sh index de120bd..40d888a 100755 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -31,6 +31,8 @@ source "$GENTOO_INSTALL_REPO_DIR/scripts/functions.sh" [[ $I_HAVE_READ_AND_EDITED_THE_CONFIG_PROPERLY == true ]] \ || die "You have not properly read the config. Set I_HAVE_READ_AND_EDITED_THE_CONFIG_PROPERLY=true to continue." +preprocess_config + mkdir_or_die 0755 "$TMP_DIR" [[ $EUID == 0 ]] \ || die "Must be root" diff --git a/scripts/utils.sh b/scripts/utils.sh index 45a20fa..9f6a8bf 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -18,7 +18,8 @@ eerror() { die() { eerror "$*" - kill "$GENTOO_INSTALL_REPO_SCRIPT_PID" + echo "Aborted." >&2 + kill "$GENTOO_INSTALL_REPO_SCRIPT_PID" >/dev/null exit 1 }