| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
tmpfile1=$(mktemp) |
| 4 |
if [ ! -w $tmpfile1 ] ; then |
| 5 |
echo "Failed to create tmp file" >&2 |
| 6 |
exit 1 |
| 7 |
fi |
| 8 |
|
| 9 |
touch $tmpfile1 |
| 10 |
|
| 11 |
RULESET="include \"$tmpfile1\" |
| 12 |
) |
| 13 |
" |
| 14 |
|
| 15 |
tmpfile2=$(mktemp) |
| 16 |
if [ ! -w $tmpfile2 ] ; then |
| 17 |
echo "Failed to create tmp file" >&2 |
| 18 |
exit 1 |
| 19 |
fi |
| 20 |
|
| 21 |
tmpfile3=$(mktemp) |
| 22 |
if [ ! -w $tmpfile3 ] ; then |
| 23 |
echo "Failed to create tmp file" >&2 |
| 24 |
exit 1 |
| 25 |
fi |
| 26 |
|
| 27 |
echo "/dev/stdin:2:1-1: Error: syntax error, unexpected ')' |
| 28 |
) |
| 29 |
^" > $tmpfile3 |
| 30 |
|
| 31 |
$NFT -I/tmp/ -f - <<< "$RULESET" 2> $tmpfile2 |
| 32 |
$DIFF -u $tmpfile2 $tmpfile3 |
| 33 |
|
| 34 |
rm $tmpfile1 $tmpfile2 $tmpfile3 |