From 7deadcb9881da9cb32b6291a49523130550b87cd Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Mon, 1 Oct 2018 22:55:52 +0200 Subject: [PATCH] test.sh: do not continue if http server failed to start --- test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index a0501e2..b7f98e2 100755 --- a/test.sh +++ b/test.sh @@ -30,14 +30,20 @@ fi ./make_mirror.sh -trap 'kill $pid' INT QUIT TERM EXIT - cd mirror python3 -m http.server 8000 2>/dev/null & pid=$! cd - # wait for the server to start sleep 1 + +if ! kill -0 $pid; then + echo "failed to start http server" + exit 1 +fi + +trap 'kill $pid' INT QUIT TERM EXIT + echo "running http server with pid $pid" export SOURCE_DATE_EPOCH=$(date +%s)