luci-app-statistics: Fix variable scope
authorPaul Donald <[email protected]>
Sat, 14 Sep 2024 17:19:15 +0000 (19:19 +0200)
committerPaul Donald <[email protected]>
Sat, 14 Sep 2024 18:42:51 +0000 (20:42 +0200)
Closes #7245

Signed-off-by: Paul Donald <[email protected]>
applications/luci-app-statistics/root/usr/libexec/stat-genconfig

index 1bf622d9c12e6dacc4dfb1a25d0fb125f3c90f1f..f184e880b2ac2e39ae49986fce43d0398b2e550e 100755 (executable)
@@ -196,7 +196,7 @@ function config_iptables(c) {
                                let tname = `${s.table}`;
                                let chain = `${s.chain}`;
 
-                               if (match(tname, /^\S+$/) && match(chain, /^\S+$/) && match(rule, /^\S+$/) && match(name, /^\S+$/)) {
+                               if (match(tname, /^\S+$/) && match(chain, /^\S+$/) {
                                        str += `\t${verb} "${tname}" "${chain}"`;
 
                                        let rule = `${s.rule}`;
@@ -208,10 +208,10 @@ function config_iptables(c) {
 
                                                if (match(name, /^\S+$/))
                                                        str += ` "${name}"`;
-                                       }
+                                               }
 
-                                       str += '\n';
                                }
+                               str += '\n';
                        }
                }
        }