]> git.99rst.org Git - openwrt-packages.git/commitdiff
nodogsplash: fix config generation in the init script
authorJosef Schlehofer <redacted>
Thu, 6 Aug 2026 10:55:52 +0000 (12:55 +0200)
committerJosef Schlehofer <redacted>
Sat, 15 Aug 2026 21:31:16 +0000 (23:31 +0200)
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 <redacted>
Co-authored-by: Claude Fable 5 <redacted>
net/nodogsplash/files/etc/init.d/nodogsplash

index 4af51ca2476f6f6649ac07266927fc1ed1b7dc50..8b186486c0649216a24e81812584265589272128 100755 (executable)
@@ -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
git clone https://git.99rst.org/PROJECT