From 24dc2c887a64bd76d1d106612f1642ba2660ec05 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:46:16 +0200 Subject: [PATCH] Config File --- misc/config-file.func | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index af21032..46f7bb1 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 "\n${NETWORK}${BOLD}${DGN}Found free IP Address: ${BGN}$NET${CL}" + echo -e "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" break fi done @@ -329,18 +329,8 @@ config_file() { echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" GATE=",gw=$GATE" else - 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 + msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" + exit fi else while true; do @@ -637,7 +627,6 @@ config_file() { if (whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "ADVANCED SETTINGS WITH CONFIG FILE COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then echo -e "${CREATING}${BOLD}${RD}Creating a ${APP} LXC using the above settings${CL}" - write_config else clear header_info