blob: 05bb23d8b714ef69c62a777f6294942851e57511 [file] [log] [blame]
#!/bin/bash
shopt -s nullglob
declare -A basemap=()
i=0
for dir in /run/nftables /etc/nftables /usr/share/nftables; do
for file in "$dir"/*.rules; do
basemap["${file##*/}$i"]="$file"
done
let i+=1
done
rc=0
nft flush ruleset || rc=$?
for key in $(printf "%s\n" "${!basemap[@]}" | sort -r); do
echo "Executing ${basemap[$key]}" >&2
nft -f "${basemap[$key]}" || rc=$?
done
exit $rc