mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-01-09 16:02:52 +01:00
19 lines
330 B
Plaintext
19 lines
330 B
Plaintext
|
#!/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
|