aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gnunet_gns.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gnunet_gns.sh')
-rwxr-xr-xsrc/gns/test_gnunet_gns.sh25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gns/test_gnunet_gns.sh b/src/gns/test_gnunet_gns.sh
index f6b4e721a..74c49c537 100755
--- a/src/gns/test_gnunet_gns.sh
+++ b/src/gns/test_gnunet_gns.sh
@@ -1,15 +1,25 @@
1#!/bin/bash 1#!/bin/sh
2# This file is in the public domain. 2# This file is in the public domain.
3LOCATION=$(which gnunet-config) 3# test -z being correct was a false assumption here.
4if [ -z $LOCATION ] 4# I have no executable 'fooble', but this will
5then 5# return 1:
6 LOCATION="gnunet-config" 6# if test -z "`which fooble`"; then echo 1; fi
7# The command builtin might not work with busybox's ash
8# but this works for now.
9existence()
10{
11 command -v "$1" >/dev/null 2>&1
12}
13
14LOCATION=`existence gnunet-config`
15if test -z $LOCATION; then
16 LOCATION="gnunet-config"
7fi 17fi
8$LOCATION --version 18$LOCATION --version
9if test $? != 0 19if test $? != 0
10then 20then
11 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" 21 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
12 exit 77 22 exit 77
13fi 23fi
14 24
15trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT 25trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
@@ -32,4 +42,5 @@ if [ "$LO" != "Address: 4.5.6.7" ]
32then 42then
33 echo "Fail: $LO" 43 echo "Fail: $LO"
34fi 44fi
45# XXX: jobs. a builtin by bash, netbsd sh, maybe leave it be for now.
35kill `jobs -p` 46kill `jobs -p`