diff --git a/misc/config-file.func b/misc/config-file.func index 2c168d2..af21032 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -316,7 +316,7 @@ config_file() { msg_info "Checking IP: $ip" if ! ping -c 4 -W 1 "$ip" >/dev/null 2>&1; then NET="$ip/$cidr" - echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}" + echo -e "\n${NETWORK}${BOLD}${DGN}Found free IP Address: ${BGN}$NET${CL}" break fi done @@ -329,8 +329,18 @@ config_file() { echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" GATE=",gw=$GATE" else - msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" - exit + while true; do + GATE1=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Enter gateway IP address" 8 58 --title "Gateway IP" 3>&1 1>&2 2>&3) + if [ -z "$GATE1" ]; then + whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 + elif [[ ! "$GATE1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then + whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 + else + GATE=",gw=$GATE1" + echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}" + break + fi + done fi else while true; do