Enhance config_file function to handle empty Container ID and improve password variable expansion syntax

This commit is contained in:
Michel Roegl-Brunner 2025-05-16 10:36:59 +02:00
parent f9ef70473f
commit ffb7e4acd2

View File

@ -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