From fc461d11a86bd33ca70259b85a4aa7d6875e12c9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 23 Aug 2023 09:32:51 +0200 Subject: shellcheck fixes --- src/bank-lib/test_bank.sh | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/bank-lib/test_bank.sh b/src/bank-lib/test_bank.sh index 7d72497ea..686f78dde 100755 --- a/src/bank-lib/test_bank.sh +++ b/src/bank-lib/test_bank.sh @@ -1,20 +1,20 @@ #!/bin/bash # This file is in the public domain. - +# shellcheck disable=SC2317 set -eu # Exit, with status code "skip" (no 'real' failure) function exit_skip() { - echo $1 + echo "$1" exit 77 } # Cleanup to run whenever we exit function cleanup() { - for n in `jobs -p` + for n in $(jobs -p) do - kill $n 2> /dev/null || true + kill "$n" 2> /dev/null || true done wait } @@ -24,21 +24,30 @@ trap cleanup EXIT echo -n "Launching bank..." -taler-fakebank-run -c test_bank.conf -L DEBUG &> bank.log & +taler-fakebank-run \ + -c test_bank.conf \ + -L DEBUG &> bank.log & # Wait for bank to be available (usually the slowest) -for n in `seq 1 50` +for n in $(seq 1 50) do echo -n "." sleep 0.2 OK=0 # bank - wget --tries=1 --timeout=1 http://localhost:8899/ -o /dev/null -O /dev/null >/dev/null || continue + wget \ + --tries=1 \ + --timeout=1 \ + http://localhost:8899/ \ + -o /dev/null \ + -O /dev/null \ + >/dev/null \ + || continue OK=1 break done -if [ 1 != $OK ] +if [ 1 != "$OK" ] then exit_skip "Failed to launch services (bank)" fi @@ -56,7 +65,11 @@ echo " OK" echo -n "Requesting exchange incoming transaction list ..." -./taler-exchange-wire-gateway-client -b http://localhost:8899/exchange/ -i | grep TESTKUDOS:4 > /dev/null +./taler-exchange-wire-gateway-client \ + -b http://localhost:8899/exchange/ \ + -i \ + | grep TESTKUDOS:4 \ + > /dev/null echo " OK" @@ -73,7 +86,11 @@ echo " OK" echo -n "Requesting exchange's outgoing transaction list..." -./taler-exchange-wire-gateway-client -b http://localhost:8899/exchange/ -o | grep TESTKUDOS:2 > /dev/null +./taler-exchange-wire-gateway-client \ + -b http://localhost:8899/exchange/ \ + -o \ + | grep TESTKUDOS:2 \ + > /dev/null echo " OK" -- cgit v1.2.3