summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-28 18:30:44 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-28 18:30:44 +0200
commit1ef9735115730c5d236791ce0c4353d548110159 (patch)
treed59d712f250867faa0ad37c2527512a46479c5ea
parent51fa812cf47d8238cca784834a70eafcd0306d04 (diff)
downloadexchange-1ef9735115730c5d236791ce0c4353d548110159.tar.gz
exchange-1ef9735115730c5d236791ce0c4353d548110159.tar.bz2
exchange-1ef9735115730c5d236791ce0c4353d548110159.zip
nicer process killing
-rwxr-xr-xsrc/auditor/generate-revoke-basedb.sh23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/auditor/generate-revoke-basedb.sh b/src/auditor/generate-revoke-basedb.sh
index 5ec1f5ca..71af4fde 100755
--- a/src/auditor/generate-revoke-basedb.sh
+++ b/src/auditor/generate-revoke-basedb.sh
@@ -7,8 +7,18 @@
#
set -eu
+# Cleanup to run whenever we exit
+function cleanup()
+{
+ for n in `jobs -p`
+ do
+ kill $n 2> /dev/null || true
+ done
+ wait
+}
-trap "kill `jobs -p` &> /dev/null || true" ERR
+# Install cleanup handler (except for kill -9)
+trap cleanup EXIT
# Exit, with status code "skip" (no 'real' failure)
function exit_skip() {
@@ -131,12 +141,16 @@ done
if [ 1 != $OK ]
then
- kill `jobs -p`
- wait
+ cleanup
exit_skip "Failed to launch services"
fi
echo " DONE"
+# Setup merchant
+
+curl -H "Content-Type: application/json" -X POST -d '{"payto_uris":["payto://x-taler-bank/localhost:8082/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 3600000},"default_pay_delay":{"d_ms": 3600000}}' http://localhost:9966/private/instances
+
+
# run wallet CLI
echo "Running wallet"
@@ -303,8 +317,7 @@ taler-wallet-cli $TIMETRAVEL --wallet-db=$WALLET_DB run-until-done
echo "Bought something with refresh-recouped coin"
echo "Shutting down services"
-kill `jobs -p`
-wait
+cleanup
# Dump database