* Fixed firewall script
authorSteven Barth <steven@midlink.org>
Thu, 3 Apr 2008 10:10:48 +0000 (10:10 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 3 Apr 2008 10:10:48 +0000 (10:10 +0000)
contrib/init.d/luci_fw

index 766a5313dea2c579d8608216286f71e190f9ca60..880c87dbe39bc52dc8351faf86cd36c5e7877832 100644 (file)
@@ -9,7 +9,11 @@ apply_portfw() {
        config_get to    "$cfg" to
 
        ports=$(echo $to | cut -sd: -f2)
-       [ -n "$ports" ] && ports="--dport $(echo $ports | sed -e 's/-/:/')"
+       if [ -n "$ports" ]; then
+               ports="--dport $(echo $ports | sed -e 's/-/:/')"
+       else
+               ports="--dport $dport"
+       fi
 
        ip=$(echo $to | cut -d: -f1)