fix: removing ",gw=" from GATE variable when reading/writing from/to config. (#6177)

Previously when creating a config, GATE variable would incluse ",gw="
which was crashing the installer script when read later on.
This fix:
1. writes GATE variable to config without ",gw="
2. removes ",gw=" from GATE variable when reading existing config

Co-authored-by: teohz <git@teohz.com>
This commit is contained in:
teohz
2025-07-28 13:11:52 +00:00
committed by GitHub
parent 7b82199a36
commit 15e3958687
2 changed files with 3 additions and 1 deletions

View File

@@ -249,6 +249,7 @@ write_config() {
# This function writes the configuration to a file.
if whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "Write configfile" --yesno "Do you want to write the selections to a config file?" 10 60; then
FILEPATH="/opt/community-scripts/${NSAPP}.conf"
[[ "$GATE" =~ ",gw=" ]] && local GATE="${GATE##,gw=}"
if [[ ! -f $FILEPATH ]]; then
cat <<EOF >"$FILEPATH"
# ${NSAPP} Configuration File