aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_rebind.sh
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2019-01-22 15:14:16 +0200
committerrl1987 <rl1987@sdf.lonestar.org>2019-01-22 15:14:16 +0200
commit00fff96e4884e295a767532aa570abf8d27e75ee (patch)
tree2b1e9fb8b344593963f837788c8ba87571c28d2f /src/test/test_rebind.sh
parentd1af4d65df8b5ef8049707029335049db147829f (diff)
downloadtor-00fff96e4884e295a767532aa570abf8d27e75ee.tar.gz
tor-00fff96e4884e295a767532aa570abf8d27e75ee.zip
Fix shellcheck warning in test_rebind.sh
Diffstat (limited to 'src/test/test_rebind.sh')
-rwxr-xr-xsrc/test/test_rebind.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/test_rebind.sh b/src/test/test_rebind.sh
index 498072de35..a8f07c7c1e 100755
--- a/src/test/test_rebind.sh
+++ b/src/test/test_rebind.sh
@@ -15,10 +15,15 @@ fi
exitcode=0
tmpdir=
-clean () { test -n "$tmpdir" && test -d "$tmpdir" && rm -rf "$tmpdir" || :; }
+clean () {
+ if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
+ rm -rf "$tmpdir"
+ fi
+}
+
trap clean EXIT HUP INT TERM
-tmpdir="`mktemp -d -t tor_rebind_test.XXXXXX`"
+tmpdir="$(mktemp -d -t tor_rebind_test.XXXXXX)"
if [ -z "$tmpdir" ]; then
echo >&2 mktemp failed
exit 2