Enhance config_file function to handle empty Container ID and improve password variable expansion syntax
This commit is contained in:
parent
f9ef70473f
commit
ffb7e4acd2
@ -819,8 +819,17 @@ config_file() {
|
||||
exit
|
||||
fi
|
||||
else
|
||||
msg_error "Container ID cannot be empty"
|
||||
exit
|
||||
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"
|
||||
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}"
|
||||
else
|
||||
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}"
|
||||
fi
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
|
||||
fi
|
||||
if [[ -n "$CT_TYPE" ]]; then
|
||||
if [[ "$CT_TYPE" -eq 0 ]]; then
|
||||
@ -837,7 +846,7 @@ config_file() {
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -n "$PW" ]]; then
|
||||
if [[ -n "${PW-}" ]]; then
|
||||
if [[ "$PW" == *" "* ]]; then
|
||||
msg_error "Password cannot be empty"
|
||||
exit
|
||||
|
Loading…
x
Reference in New Issue
Block a user