Add QoS firewall stop script generation
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 27 Oct 2011 12:39:19 +0000 (12:39 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 27 Oct 2011 12:39:19 +0000 (12:39 +0000)
To prevent code duplication for clearing QoS firewall rules, support
"firewall stop" arguments to generate.sh to generate the necessary
script commands.  Make use of this from qos-stop.

Signed-off-by: Kevin Locke <klocke@digitalenginesoftware.com>
SVN-Revision: 28623

package/qos-scripts/files/usr/bin/qos-stop
package/qos-scripts/files/usr/lib/qos/generate.sh

index d0243bea13c1af1e082887dca76be79cef924435..7f654d85877b1e8dc342bd37f5edf5466f2851f1 100755 (executable)
@@ -3,5 +3,4 @@ for iface in $(tc qdisc show | grep -E '(hfsc|ingress)' | awk '{print $5}'); do
        tc qdisc del dev "$iface" ingress 2>&- >&-
        tc qdisc del dev "$iface" root 2>&- >&-
 done
-iptables -t mangle -F
-iptables -t mangle -X
+/usr/lib/qos/generate.sh firewall stop | sh
index 093967f7a1cfd0a4d53716f1da3cdb8fbc528a96..a983d159ae2d3be10e8c13bdac0059451c2a67db 100755 (executable)
@@ -486,6 +486,13 @@ case "$1" in
                start_interfaces
        ;;
        firewall)
-               start_firewall
+               case "$2" in
+                       stop)
+                               stop_firewall
+                       ;;
+                       start|"")
+                               start_firewall
+                       ;;
+               esac
        ;;
 esac