aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-03-09 10:34:22 +0000
committerng0 <ng0@n0.is>2019-03-09 10:34:22 +0000
commita21da39e0c7bb11f330b20bddba3fb88259ca4ff (patch)
tree0cf901d33e71e57318f85379ad579b9925b5e810
parentdd0578a4bd4a3c1f7a685627a27fb2c18603f5ca (diff)
downloadgnunet-a21da39e0c7bb11f330b20bddba3fb88259ca4ff.tar.gz
gnunet-a21da39e0c7bb11f330b20bddba3fb88259ca4ff.zip
dns: bashism. Add check for iptables.
-rwxr-xr-xsrc/dns/test_gnunet_dns.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dns/test_gnunet_dns.sh b/src/dns/test_gnunet_dns.sh
index 57b9716f5..0fa338c9b 100755
--- a/src/dns/test_gnunet_dns.sh
+++ b/src/dns/test_gnunet_dns.sh
@@ -1,4 +1,4 @@
1#!/bin/bash 1#!/bin/sh
2 2
3ME=`whoami` 3ME=`whoami`
4if [ "$ME" != "root" ] 4if [ "$ME" != "root" ]
@@ -26,12 +26,17 @@ then
26 echo "This test requires nslookup. Skipping." 26 echo "This test requires nslookup. Skipping."
27 exit 77 27 exit 77
28fi 28fi
29if ! iptables -t mangle --list &> /dev/null 29if [ ! -x `which iptables` ]
30then
31 echo "This test requires iptables. Skipping."
32 exit 77
33fi
34if ! iptables -t mangle --list > /dev/null 2>&1
30then 35then
31 echo "This test requires iptables with 'mangle' support. Skipping." 36 echo "This test requires iptables with 'mangle' support. Skipping."
32 exit 77 37 exit 77
33fi 38fi
34if grep % /etc/resolv.conf &> /dev/null 39if grep % /etc/resolv.conf > /dev/null 2>&1
35then 40then
36 echo "This system seems to use a DNS server on an IPv6 link-local address, which is not supported. Skipping." 41 echo "This system seems to use a DNS server on an IPv6 link-local address, which is not supported. Skipping."
37 exit 77 42 exit 77
@@ -52,5 +57,6 @@ else
52 echo "Test run, with success." 57 echo "Test run, with success."
53 ret=0 58 ret=0
54fi 59fi
60# TODO: jobs is a possible bashism. Fix.
55kill `jobs -p` 61kill `jobs -p`
56exit $ret 62exit $ret