From a21da39e0c7bb11f330b20bddba3fb88259ca4ff Mon Sep 17 00:00:00 2001 From: ng0 Date: Sat, 9 Mar 2019 10:34:22 +0000 Subject: [PATCH] dns: bashism. Add check for iptables. --- src/dns/test_gnunet_dns.sh | 12 +++++++++--- 1 file 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 @@ -#!/bin/bash +#!/bin/sh ME=`whoami` if [ "$ME" != "root" ] @@ -26,12 +26,17 @@ then echo "This test requires nslookup. Skipping." exit 77 fi -if ! iptables -t mangle --list &> /dev/null +if [ ! -x `which iptables` ] +then + echo "This test requires iptables. Skipping." + exit 77 +fi +if ! iptables -t mangle --list > /dev/null 2>&1 then echo "This test requires iptables with 'mangle' support. Skipping." exit 77 fi -if grep % /etc/resolv.conf &> /dev/null +if grep % /etc/resolv.conf > /dev/null 2>&1 then echo "This system seems to use a DNS server on an IPv6 link-local address, which is not supported. Skipping." exit 77 @@ -52,5 +57,6 @@ else echo "Test run, with success." ret=0 fi +# TODO: jobs is a possible bashism. Fix. kill `jobs -p` exit $ret -- 2.25.1