diff options
author | root <root@rshg054.dnsready.net> | 2012-06-24 00:04:12 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-06-24 00:04:12 +0000 |
commit | 4319f36e44d4e7c70bf010c3286bb1739c59d4de (patch) | |
tree | 570e5a756192067d69cbabeab8fcf6b81cec3c51 /core/iptables/iptables-flush | |
parent | 11357a5ab02a7d536375fb8333b2fb67278b4a36 (diff) |
Sun Jun 24 00:04:11 UTC 2012
Diffstat (limited to 'core/iptables/iptables-flush')
-rwxr-xr-x | core/iptables/iptables-flush | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/iptables/iptables-flush b/core/iptables/iptables-flush new file mode 100755 index 000000000..e6fafe950 --- /dev/null +++ b/core/iptables/iptables-flush @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Usage: iptables-flush [6] +# + +iptables=ip$1tables +if ! type -p "$iptables"; then + echo "error: invalid argument" + exit 1 +fi + +while read -r table; do + tables+=("/var/lib/$iptables/empty-$table.rules") +done <"/proc/net/ip$1_tables_names" + +if (( ${#tables[*]} )); then + cat "${tables[@]}" | "$iptables-restore" +fi |