blob: a82c2826f1060a03f0b1e4f9041dad4500c5f491 [file] [log] [blame]
William A. Kennington IIIc20feb72021-03-08 12:31:30 -08001#!/bin/bash
2shopt -s nullglob
3declare -A basemap=()
4i=0
5for dir in /run/nftables /etc/nftables /usr/share/nftables; do
6 for file in "$dir"/*.rules; do
7 basemap["${file##*/}$i"]="$file"
8 done
9 let i+=1
10done
11rc=0
12for key in $(printf "%s\n" "${!basemap[@]}" | sort -r); do
13 echo "Executing ${basemap[$key]}" >&2
14 nft -f "${basemap[$key]}" || rc=$?
15done
16exit $rc