Debian Codegraph @

tests/shell/testcases/include/0006glob_single_0

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