From babd5e8c6c413f0346ab693a6832ccf03650b4bb Mon Sep 17 00:00:00 2001 From: Bernard Ogden Date: Thu, 11 Dec 2014 13:45:02 +0000 Subject: Stop producing output we never need Required inventing a new way of stalling until signal --- scripts/lava.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/lava.sh b/scripts/lava.sh index 91841f7..9b3980c 100755 --- a/scripts/lava.sh +++ b/scripts/lava.sh @@ -6,11 +6,16 @@ set -o pipefail if test $? -ne 0; then echo "Unable to source `dirname $0`/listener.sh" fi +waiter= error=1 trap 'exit ${error}' TERM INT HUP QUIT release() { + if test x"${waiter}" != x; then + kill "${waiter}" + wait "${waiter}" + fi if test -d "${temps}"; then rm -rf "${temps}" if test $? -ne 0; then @@ -230,8 +235,8 @@ if test x"${user_ip}" = x; then fi echo "LAVA target ready at ${user_ip}" -#Continue to report whatever comes across the listener -while true; do - read line <&4 - echo "${line}" -done + +#Wait to be killed, at which point we cancel the job +sleep infinity & +waiter=$! +wait ${waiter} -- cgit v1.2.3