archrelease: copy trunk to staging-x86_64
[arch-packages.git] / iptables / trunk / iptables-nft-flush
blob5038d329ac967c1247127ed29120318308bf1c6b
1 #!/bin/bash
3 # Usage: iptables-flush [6]
6 iptables=ip$1tables
7 if ! type -p "$iptables" &>/dev/null; then
8 echo "error: invalid argument"
9 exit 1
12 while read -r table; do
13 tables+=("/usr/share/iptables/empty-$table.rules")
14 done < <(nft list tables | sed -n "s/table ip$1 //p")
16 if (( ${#tables[*]} )); then
17 cat "${tables[@]}" | "$iptables-restore"