From f99caea570c40754f25da612227ac355797f7d11 Mon Sep 17 00:00:00 2001 From: sean Date: Fri, 12 Jul 2019 17:18:23 -0700 Subject: [PATCH] tweaks --- setup.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 0972bf3..1041972 100644 --- a/setup.sh +++ b/setup.sh @@ -44,13 +44,16 @@ hostname=""; while [ -z "$hostname" ]; do hostname=`dialog --no-cancel --inputbo nicdevices=""; for nic in $(ip -o link show | awk -F': ' '{print $2}' | grep -v '^lo'); do nicdevices="$nicdevices $nic off"; done nics=`dialog --separate-output --no-cancel --no-items --title "Bridged network devices" --checklist "Select the network devices to be bridged to br0:" $height $width ${window}$nicdevices 2>&1 1>/dev/tty` admin=""; while [ -z "$admin" ]; do admin=`dialog --no-cancel --inputbox "Admin user:" 8 40 2>&1 >/dev/tty`; done -rootpassword=`dialog --no-cancel --title "Root password" --insecure --passwordbox "Enter root password:" 8 40 2>&1 1>/dev/tty` -confirmpassword=`dialog --no-cancel --title "Root password confirmation" --insecure --passwordbox "Re-enter root password:" 8 40 2>&1 1>/dev/tty` +rootpassword="" +while [ "$rootpassword" = "" ]; do + rootpassword=`dialog --no-cancel --title "Root password" --insecure --passwordbox "Enter root password:" 8 40 2>&1 1>/dev/tty` + confirmpassword=`dialog --no-cancel --title "Root password confirmation" --insecure --passwordbox "Re-enter root password:" 8 40 2>&1 1>/dev/tty` + if ! [ "$rootpassword" = "$confirmpassword" ]; then + echo "Password does not match confirmation - please retry the setup" + rootpassword="" + fi +done admins=`dialog --no-items --no-cancel --title "Root pool ZFS RAID" --inputbox "List administrator e-mail addresses separated by comma:" 10 40 2>&1 1>/dev/tty` -if ! [ "$rootpassword" = "$confirmpassword" ]; then - echo "Password does not match confirmation - please retry the setup" - exit 10 -fi timezone=`dialog --no-cancel --title "Timezone" --inputbox "Time zone:" 8 40 "America/Los_Angeles" 2>&1 1>/dev/tty` for disk in `echo "$disks"`; do