Debian Codegraph @

tests/shell/testcases/include/0001absolute_0

raw
1 #!/bin/bash
2
3 set -e
4
5 tmpfile1=$(mktemp)
6 if [ ! -w $tmpfile1 ] ; then
7 echo "Failed to create tmp file" >&2
8 exit 0
9 fi
10
11 tmpfile2=$(mktemp)
12 if [ ! -w $tmpfile2 ] ; then
13 echo "Failed to create tmp file" >&2
14 exit 0
15 fi
16
17 trap "rm -rf $tmpfile1 $tmpfile2" EXIT # cleanup if aborted
18
19 RULESET1="add table x"
20 RULESET2="include \"$tmpfile1\""
21
22 echo "$RULESET1" > $tmpfile1
23 echo "$RULESET2" > $tmpfile2
24
25 $NFT -f $tmpfile2
26 if [ $? -ne 0 ] ; then
27 echo "E: unable to load good ruleset" >&2
28 exit 1
29 fi