diff options
Diffstat (limited to 'src/gns/test_gnunet_gns.sh')
-rwxr-xr-x | src/gns/test_gnunet_gns.sh | 25 |
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. |
3 | LOCATION=$(which gnunet-config) | 3 | # test -z being correct was a false assumption here. |
4 | if [ -z $LOCATION ] | 4 | # I have no executable 'fooble', but this will |
5 | then | 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. | ||
9 | existence() | ||
10 | { | ||
11 | command -v "$1" >/dev/null 2>&1 | ||
12 | } | ||
13 | |||
14 | LOCATION=`existence gnunet-config` | ||
15 | if test -z $LOCATION; then | ||
16 | LOCATION="gnunet-config" | ||
7 | fi | 17 | fi |
8 | $LOCATION --version | 18 | $LOCATION --version |
9 | if test $? != 0 | 19 | if test $? != 0 |
10 | then | 20 | then |
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 |
13 | fi | 23 | fi |
14 | 24 | ||
15 | trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT | 25 | trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT |
@@ -32,4 +42,5 @@ if [ "$LO" != "Address: 4.5.6.7" ] | |||
32 | then | 42 | then |
33 | echo "Fail: $LO" | 43 | echo "Fail: $LO" |
34 | fi | 44 | fi |
45 | # XXX: jobs. a builtin by bash, netbsd sh, maybe leave it be for now. | ||
35 | kill `jobs -p` | 46 | kill `jobs -p` |