From 425a26d88a5cac02701b90b2f526a0826ab8876e Mon Sep 17 00:00:00 2001 From: natemaia Date: Fri, 11 Jan 2019 16:37:14 -0800 Subject: [PATCH] Check for user creation before allowing config --- src/archlabs-installer | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/archlabs-installer b/src/archlabs-installer index 07d7a4a..aa07699 100755 --- a/src/archlabs-installer +++ b/src/archlabs-installer @@ -8,7 +8,7 @@ # Some ideas and code has been taken from other installers # AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due -VER="1.8.9" # version +VER="1.8.11" # version DIST="ArchLabs" # distributor MNT="/mnt" # mountpoint @@ -52,12 +52,12 @@ main() 3) luks_menu || SELECTED=$((SELECTED - 1)) ;; 4) lvm_menu || SELECTED=$((SELECTED - 1)) ;; 5) mnt_menu || SELECTED=$((SELECTED - 1)) ;; - 6) prechecks && { mkuser || SELECTED=$((SELECTED - 1)); } ;; - 7) prechecks && { cfg_menu || SELECTED=$((SELECTED - 1)); } ;; - 8) prechecks 1 && { select_wm_or_de || SELECTED=$((SELECTED - 1)); } ;; - 9) prechecks 1 && { select_packages || SELECTED=$((SELECTED - 1)); } ;; - 10) prechecks 1 && show_cfg ;; - 11) prechecks 1 && install ;; + 6) prechecks 0 && { mkuser || SELECTED=$((SELECTED - 1)); } ;; + 7) prechecks 1 && { cfg_menu || SELECTED=$((SELECTED - 1)); } ;; + 8) prechecks 2 && { select_wm_or_de || SELECTED=$((SELECTED - 1)); } ;; + 9) prechecks 2 && { select_packages || SELECTED=$((SELECTED - 1)); } ;; + 10) prechecks 2 && show_cfg ;; + 11) prechecks 2 && install ;; *) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die esac } @@ -2415,15 +2415,15 @@ system_checks() prechecks() { - if ! [[ $(lsblk -o MOUNTPOINT) =~ $MNT ]]; then + if [[ $1 -ge 0 ]] && ! [[ $(lsblk -o MOUNTPOINT) =~ $MNT ]]; then msgbox "$_ErrTitle" "$_ErrNoMount" SELECTED=4 return 1 - elif [[ $# -eq 1 && ! $NEWUSER ]]; then + elif [[ $1 -ge 1 && ! $NEWUSER ]]; then msgbox "$_ErrTitle" "\nYou need to create a user first.\n" SELECTED=5 return 1 - elif [[ $# -eq 1 && $CONFIG_DONE != true ]]; then + elif [[ $1 -ge 2 && $CONFIG_DONE != true ]]; then msgbox "$_ErrTitle" "$_ErrNoConfig" SELECTED=6 return 1