diff --git a/scripts/run.sh b/scripts/run.sh index ae5933c..45c1bf6 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,13 +1,17 @@ #!/bin/bash set -eu +trap 'kill $(jobs -p)' EXIT + +DELAY=5 +LOG=/tmp/electrs.log +tail -v -n0 -F "$LOG" & -T=5 export RUST_BACKTRACE=1 while : do cargo fmt cargo check --release - cargo run --release -- $* - echo "Restarting in $T seconds..." - sleep $T + cargo run --release -- $* 2>> "$LOG" + echo "Restarting in $DELAY seconds..." + sleep $DELAY done