From 4ed8fc37428e3041d7169fe6e789ca25dbad33f7 Mon Sep 17 00:00:00 2001 From: Dan Johansen Date: Wed, 8 May 2019 08:47:55 +0200 Subject: [PATCH] added confirm password prompts --- manjaro-arm-installer | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/manjaro-arm-installer b/manjaro-arm-installer index 2efda87..5097e46 100755 --- a/manjaro-arm-installer +++ b/manjaro-arm-installer @@ -14,6 +14,8 @@ DEVICE="" EDITION="" USER="" PASSWORD="" +CONFIRMPASSWORD="" +CONFIRMROOTPASSWORD="" ROOTPASSWORD="" SDCARD="" SDTYP="" @@ -411,10 +413,25 @@ else exit 1 fi - - if [ ! -z "$PASSWORD" ] then +CONFIRMPASSWORD=$(dialog --clear --title "Manjaro ARM Installer" \ + --insecure --passwordbox "Confirm Password for $USER:" 8 50 \ + 3>&1 1>&2 2>&3 3>&- \ + ) +else + clear + exit 1 +fi + +if [[ "$PASSWORD" != "$CONFIRMPASSWORD" ]]; then + clear + msg "User passwords do not match! Please restart the installer and try again." + exit 1 +fi + +if [ ! -z "$CONFIRMPASSWORD" ] +then ROOTPASSWORD=$(dialog --clear --title "Manjaro ARM Installer" \ --insecure --passwordbox "Enter Root Password:" 8 50 \ 3>&1 1>&2 2>&3 3>&- \ @@ -424,11 +441,25 @@ else exit 1 fi - - - if [ ! -z "$ROOTPASSWORD" ] then +CONFIRMROOTPASSWORD=$(dialog --clear --title "Manjaro ARM Installer" \ + --insecure --passwordbox "Confirm Root Password:" 8 50 \ + 3>&1 1>&2 2>&3 3>&- \ + ) +else + clear + exit 1 +fi + +if [[ "$ROOTPASSWORD" != "$CONFIRMROOTPASSWORD" ]]; then + clear + msg "Root passwords do not match! Please restart the installer and try again." + exit 1 +fi + +if [ ! -z "$CONFIRMROOTPASSWORD" ] +then # simple command to put the results of lsblk (just the names of the devices) into an array and make that array populate the options let i=0