#!/usr/bin/env bash /opt/whisparr/Whisparr -nobrowser -data=/config & # terminate container when any process spawned by this shell in the background terminates for JOB in `jobs -p`; do (lsof -p $JOB +r 1 &>/dev/null; kill -s TERM 1) & done sleep infinity