From 47d973e97236d93c90d8f2fb49ccb46164e03e24 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sat, 9 Mar 2019 11:54:36 +0000 Subject: [PATCH] bashism --- src/gns/test_gns_at_lookup.sh | 6 +++--- src/gns/test_gns_cname_lookup.sh | 12 ++++++------ src/gns/test_gns_config_lookup.sh | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gns/test_gns_at_lookup.sh b/src/gns/test_gns_at_lookup.sh index d900c070b..bacc63eb0 100755 --- a/src/gns/test_gns_at_lookup.sh +++ b/src/gns/test_gns_at_lookup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # This file is in the public domain. trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT @@ -14,7 +14,7 @@ then exit 77 fi -which timeout &> /dev/null && DO_TIMEOUT="timeout 5" +which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5" rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME` TEST_IP="127.0.0.1" @@ -31,7 +31,7 @@ gnunet-namestore -z delegatedego -d -n '@' -t A -V $TEST_IP -e never -c test_gn gnunet-arm -e -c test_gns_lookup.conf rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME` -if [ "$RES_IP" == "$TEST_IP" ] +if [ "$RES_IP" = "$TEST_IP" ] then exit 0 else diff --git a/src/gns/test_gns_cname_lookup.sh b/src/gns/test_gns_cname_lookup.sh index de575c561..d97a4fe5e 100755 --- a/src/gns/test_gns_cname_lookup.sh +++ b/src/gns/test_gns_cname_lookup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # This file is in the public domain. trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT @@ -16,7 +16,7 @@ fi # permissive DNS resolver we will use for the test DNS_RESOLVER="8.8.8.8" -if ! nslookup gnunet.org $DNS_RESOLVER &> /dev/null +if ! nslookup gnunet.org $DNS_RESOLVER > /dev/null 2>&1 then echo "Cannot reach DNS, skipping test" exit 77 @@ -36,7 +36,7 @@ TEST_RECORD_NAME_DNS="www3" MY_EGO="myego" TEST_DOMAIN_PLUS="www.$MY_EGO" TEST_DOMAIN_DNS="www3.$MY_EGO" -which timeout &> /dev/null && DO_TIMEOUT="timeout 15" +which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 15" gnunet-arm -s -c test_gns_lookup.conf gnunet-identity -C $MY_EGO -c test_gns_lookup.conf @@ -57,7 +57,7 @@ rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME` # make cmp case-insensitive by converting to lower case first RES_CNAME_RAW=`echo $RES_CNAME_RAW | tr [A-Z] [a-z]` TESTEGOZONE=`echo $TESTEGOZONE | tr [A-Z] [a-z]` -if [ "$RES_CNAME_RAW" == "server.$TESTEGOZONE" ] +if [ "$RES_CNAME_RAW" = "server.$TESTEGOZONE" ] then echo "PASS: CNAME resolution from GNS" else @@ -65,7 +65,7 @@ else exit 1 fi -if [ "$RES_CNAME" == "$TEST_IP_PLUS" ] +if [ "$RES_CNAME" = "$TEST_IP_PLUS" ] then echo "PASS: IP resolution from GNS" else @@ -73,7 +73,7 @@ else exit 1 fi -if [ "$RES_CNAME_DNS" == "$TEST_IP_DNS" ] +if [ "$RES_CNAME_DNS" = "$TEST_IP_DNS" ] then echo "PASS: IP resolution from DNS" exit 0 diff --git a/src/gns/test_gns_config_lookup.sh b/src/gns/test_gns_config_lookup.sh index 35d7c32d9..1c5a62b01 100755 --- a/src/gns/test_gns_config_lookup.sh +++ b/src/gns/test_gns_config_lookup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # This file is in the public domain. trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT @@ -18,7 +18,7 @@ MY_EGO="myego" rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` CFG=`mktemp --tmpdir=$PWD` cp test_gns_lookup.conf $CFG || exit 77 -which timeout &> /dev/null && DO_TIMEOUT="timeout 5" +which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5" TEST_IP="dead::beef" gnunet-arm -s -c $CFG || exit 77 gnunet-identity -C $MY_EGO -c $CFG @@ -35,7 +35,7 @@ gnunet-arm -e -c $CFG rm -rf `gnunet-config -c $CFG -f -s paths -o GNUNET_TEST_HOME` rm $CFG -if [ "$RES_IP" == "$TEST_IP" ] +if [ "$RES_IP" = "$TEST_IP" ] then exit 0 else -- 2.25.1