blob: 14d614382e1be3d52f00d9e92a3fa711b684158b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/bash
EXPECTED="table inet filter {
map countermap {
type ipv4_addr : counter
}
}"
set -e
$NFT -f - <<< $EXPECTED
$NFT flush map inet filter countermap
GET="$($NFT list map inet filter countermap)"
if [ "$EXPECTED" != "$GET" ] ; then
DIFF="$(which diff)"
[ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
exit 1
fi
|