Debian Codegraph @

tests/shell/testcases/include/0020include_chain_0

raw
1 #!/bin/bash
2
3 set -e
4
5 tmpfile1=$(mktemp)
6
7 trap "rm -rf $tmpfile1" EXIT # cleanup if aborted
8
9 RULESET="table inet filter { }
10 include \"$tmpfile1\""
11
12 RULESET2="chain inet filter input2 {
13 type filter hook input priority filter; policy accept;
14 ip saddr 1.2.3.4 tcp dport { 22, 443, 123 } drop
15 }"
16
17 echo "$RULESET2" > $tmpfile1
18
19 RULESET3="create chain inet filter output2 {
20 type filter hook output priority filter; policy accept;
21 ip daddr 1.2.3.4 tcp dport { 22, 443, 123 } drop
22 }"
23
24 echo "$RULESET3" >> $tmpfile1
25
26 $NFT -o -f - <<< $RULESET