Reading table names from /proc instead of using grep
This commit is contained in:
parent
9d6e838aa5
commit
560dc05e2a
|
@ -17,8 +17,13 @@ stop() {
|
||||||
iptables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | iptables-restore
|
iptables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | iptables-restore
|
||||||
ip6tables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | ip6tables-restore
|
ip6tables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | ip6tables-restore
|
||||||
|
|
||||||
for i in $(iptables-save | grep -E '^\*'); do iptables -t "${i//\*/}" -X; done
|
[[ -f '/proc/net/ip_tables_names' ]] && {
|
||||||
for i in $(ip6tables-save | grep -E '^\*'); do ip6tables -t "${i//\*/}" -X; done
|
while read line; do iptables -t "$line" -X < /proc/net/ip_tables_names; done
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ -f '/proc/net/ip6_tables_names' ]] && {
|
||||||
|
while read line; do iptables -t "$line" -X < /proc/net/ip6_tables_names; done
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user