Debian Codegraph @

tests/shell/testcases/include/0003includepath_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 tmpfile3="$(basename "$tmpfile1")"
12
13 tmpfile2=$(mktemp)
14 if [ ! -w $tmpfile2 ] ; then
15 echo "Failed to create tmp file" >&2
16 exit 0
17 fi
18
19 trap "rm -rf $tmpfile1 $tmpfile2" EXIT # cleanup if aborted
20
21 RULESET1="add table x"
22 RULESET2="include \"$tmpfile3\""
23
24 echo "$RULESET1" > $tmpfile1
25 echo "$RULESET2" > $tmpfile2
26
27 $NFT -I "$(dirname "$tmpfile1")" -f $tmpfile2
28 if [ $? -ne 0 ] ; then
29 echo "E: unable to load good ruleset" >&2
30 exit 1
31 fi