commit 53ae1784e21f74d5ed6da9504f61283aaa71d125 parent 37e0945b004e7690597c8ac5f76c53c4dd1974ef Author: Christian Grothoff <grothoff@gnunet.org> Date: Sun, 14 Jan 2024 18:12:35 +0100 simpify logic Diffstat:
| M | contrib/taler-mdb-network-check.sh | | | 25 | ++++++++++--------------- |
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/contrib/taler-mdb-network-check.sh b/contrib/taler-mdb-network-check.sh @@ -118,24 +118,9 @@ function show_failure() ERROR_PID=$! } -# Function to run when our child died. -function childdeath() -{ - if ! ps "$ERROR_PID" &> /dev/null - then - wait "${ERROR_PID}" - ERROR_PID="-1" - fi - if ! ps "$CHILD_PID" &> /dev/null - then - wait "${CHILD_PID}" - CHILD_PID="-1" - fi -} # Install cleanup handler (except for kill -9) trap cleanup EXIT -trap childdeath SIGCHLD # shellcheck disable=SC2120 function check_network() @@ -219,4 +204,14 @@ do echo "Checking network status" check_network sleep 30 + if ! ps "$ERROR_PID" &> /dev/null + then + wait "${ERROR_PID}" + ERROR_PID="-1" + fi + if ! ps "$CHILD_PID" &> /dev/null + then + wait "${CHILD_PID}" + CHILD_PID="-1" + fi done