Update config-file.func (#6042)

Fix: Handle GATE variable correctly for DHCP in config file mode

This change fixes the bug by adding GATE="" to the validation block for NET="dhcp".
This commit is contained in:
ahmaddxb 2025-07-17 23:23:14 +04:00 committed by GitHub
parent 2a359b5d2d
commit da71a0fa01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -269,6 +269,7 @@ config_file() {
if [ "$NET" == "dhcp" ]; then if [ "$NET" == "dhcp" ]; then
echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}DHCP${CL}" echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}DHCP${CL}"
echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}Default${CL}" echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}Default${CL}"
GATE=""
elif [[ "$NET" =~ $ip_cidr_regex ]]; then elif [[ "$NET" =~ $ip_cidr_regex ]]; then
echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}" echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}"
if [ ! -z "$GATE" ]; then if [ ! -z "$GATE" ]; then