Config File

This commit is contained in:
Michel Roegl-Brunner 2025-05-20 09:46:16 +02:00
parent b8e3bb02d3
commit 24dc2c887a

View File

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