Bash script, failsafe for stopped docker containers