]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: use correct $nft value in EXIT trap
authorŠtěpán Němec <snemec@redhat.com>
Wed, 27 Jan 2021 14:02:03 +0000 (15:02 +0100)
committerPhil Sutter <phil@nwl.cc>
Wed, 27 Jan 2021 16:21:25 +0000 (17:21 +0100)
With double quotes, $nft was being expanded to the default value even
in presence of the -H option.

Signed-off-by: Štěpán Němec <snemec@redhat.com>
Helped-by: Tomáš Doležal <todoleza@redhat.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/monitor/run-tests.sh

index 5a736fc6803b887ee56f33b4a4e93330ebeba9b0..1fe613c7bc3016d13dcca0d2c83c96e0e121184e 100755 (executable)
@@ -19,7 +19,7 @@ if [ ! -d $testdir ]; then
        echo "Failed to create test directory" >&2
        exit 1
 fi
-trap "rm -rf $testdir; $nft flush ruleset" EXIT
+trap 'rm -rf $testdir; $nft flush ruleset' EXIT
 
 command_file=$(mktemp -p $testdir)
 output_file=$(mktemp -p $testdir)