From b8dc6c707750dc2fa26afef1aa71b20d2a89f775 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 12:55:52 +0200 Subject: [PATCH] nodogsplash: fix config generation in the init script Three problems in the generated configuration: - The error message for a missing configuration file prints $file, which is never set, instead of $val, which holds the path. - The warning for the unsupported FAS options prints the value of the option instead of its name, so the message does not say which option is unsupported. - gatewayinterface is emitted twice: once resolved to a device via network_get_device() as "GatewayInterface", and once more by the generic option loop with the raw UCI value. When the value names a network section rather than a device, the second line overrides the resolved device with a name nodogsplash cannot use. Reported-by: openwrt-ai[bot] Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- net/nodogsplash/files/etc/init.d/nodogsplash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/nodogsplash/files/etc/init.d/nodogsplash b/net/nodogsplash/files/etc/init.d/nodogsplash index 4af51ca247..8b186486c0 100755 --- a/net/nodogsplash/files/etc/init.d/nodogsplash +++ b/net/nodogsplash/files/etc/init.d/nodogsplash @@ -119,7 +119,7 @@ generate_uci_config() { config_get val "$cfg" config if [ -n "$val" ]; then if [ ! -f "$val" ]; then - echo "Configuration file '$file' doesn't exist." >&2 + echo "Configuration file '$val' doesn't exist." >&2 return 1 fi addline "$(cat $val)" @@ -142,7 +142,7 @@ generate_uci_config() { addline "GatewayInterface $ifname" for option in preauth binauth \ - daemon debuglevel maxclients gatewayname gatewayinterface gatewayiprange \ + daemon debuglevel maxclients gatewayname gatewayiprange \ gatewayaddress gatewayport webroot splashpage statuspage \ redirecturl sessiontimeout preauthidletimeout authidletimeout checkinterval \ setmss mssvalue trafficcontrol downloadlimit uploadlimit \ @@ -158,7 +158,7 @@ generate_uci_config() { for option in fasport fasremoteip faspath fas_secure_enabled ; do config_get val "$cfg" "$option" if [ -n "$val" ]; then - echo "Warning: nodogsplash does not support $val" + echo "Warning: nodogsplash does not support $option" return 1 fi done