#!/bin/bash source venv/bin/activate PIDFILE="$(mktemp)" looper() { echo $$ > "$PIDFILE" ./build/default/looper -m rm "$PIDFILE" -f } ./build.sh || exit $? looper & tl & while [ -f "$PIDFILE" ]; do sleep 1 done for i in $(jobs -p); do kill -HUP $i done