From 91348d86ba132e9caad86ed320eccf9b2b92c8fb Mon Sep 17 00:00:00 2001 From: bbruns Date: Sun, 13 Apr 2014 16:53:18 +0000 Subject: [PATCH] Implement -f flag to flush rules --- bin/srfirewall | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/srfirewall b/bin/srfirewall index a07545d..77731d8 100755 --- a/bin/srfirewall +++ b/bin/srfirewall @@ -93,6 +93,13 @@ while getopts "hfgv" opt; do show_version exit 0 ;; + f) + [[ ${EnableIPv4} == "yes" ]] && iptables_rules_flush ipv4 + [[ ${EnableIPv6} == "yes" ]] && iptables_rules_flush ipv6 + [[ ${EnableIPv6} == "yes" ]] && default_policy_set ipv6 ACCEPT ACCEPT ACCEPT + [[ ${EnableIPv4} == "yes" ]] && default_policy_set ipv4 ACCEPT ACCEPT ACCEPT + exit 0 + ;; \?) echo "Invalid option: -$OPTARG" >&2 ;;