From c073351b4c9bd91c1fbb7f7172c3b9a79d47de61 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 23 Apr 2024 07:35:57 -0400 Subject: [PATCH] Update build.func tweak --- misc/build.func | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/misc/build.func b/misc/build.func index 93d99410..439055ff 100644 --- a/misc/build.func +++ b/misc/build.func @@ -232,15 +232,19 @@ advanced_settings() { while true; do if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then - if [ -z "$PW1" ]; then + if [[ ! -z "$PW1" ]]; then + if [[ "$PW1" == *" "* ]]; then + whiptail --msgbox "Password cannot contain spaces. Please try again." 8 58 + elif [ ${#PW1} -lt 5 ]; then + whiptail --msgbox "Password must be at least 5 characters long. Please try again." 8 58 + else + PW="-password $PW1" + echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" + break + fi + else PW1="Automatic Login" PW="" - elif [[ "$PW1" == *" "* ]]; then - whiptail --msgbox "Password cannot contain spaces. Please try again." 8 58 - elif [ ${#PW1} -ge 1 ] && [ ${#PW1} -lt 5 ]; then - whiptail --msgbox "Password must be at least 5 characters long. Please try again." 8 58 - else - PW="-password $PW1" echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}" break fi @@ -249,6 +253,7 @@ advanced_settings() { fi done + if CT_ID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then if [ -z "$CT_ID" ]; then CT_ID="$NEXTID"