#!/bin/sh $XT_MULTI iptables -w -L -n > /dev/null || exit 1 $XT_MULTI iptables -w2 -L -n > /dev/null || exit 1 echo -n '#foo' | $XT_MULTI iptables-restore -w || exit 1 # table probing for table in security raw mangle nat filter;do $XT_MULTI iptables -w2 -t $table -L -n > /dev/null done $XT_MULTI iptables -w2 -p icmp --help | grep -q 'Valid ICMP Types' || exit 1 cat <> "$tmpfile" done case "$XT_MULTI" in *xtables-nft-multi) # nft-multi displays chain names in different order, work around this for now tmpfile2=$(mktemp) sort "$tmpfile" > "$tmpfile2" sort $(dirname "$0")/dumps/ipt-save-completed.txt > "$tmpfile" diff -u $tmpfile $tmpfile2 RET=$? rm -f "$tmpfile2" ;; *) diff -u $tmpfile $(dirname "$0")/dumps/ipt-save-completed.txt RET=$? ;; esac rm -f "$tmpfile" exit $RET