mirror of
https://github.com/tteck/Proxmox.git
synced 2024-11-28 19:23:20 +01:00
Update build.func
- Check for spaces and length in passwords - fixes https://github.com/tteck/Proxmox/issues/2843
This commit is contained in:
parent
c042b7c527
commit
bf4a04528b
@ -230,17 +230,24 @@ advanced_settings() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
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
|
while true; do
|
||||||
if [ -z $PW1 ]; then
|
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
|
||||||
PW1="Automatic Login"
|
if [ -z "$PW1" ]; then
|
||||||
PW=""
|
PW1="Automatic Login"
|
||||||
|
PW=""
|
||||||
|
elif [[ "$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
|
else
|
||||||
PW="-password $PW1"
|
exit-script
|
||||||
fi
|
fi
|
||||||
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
|
done
|
||||||
else
|
|
||||||
exit-script
|
|
||||||
fi
|
|
||||||
|
|
||||||
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 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
|
if [ -z "$CT_ID" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user