Skip to content

Instantly share code, notes, and snippets.

@e0da

e0da/terminator.sh

Created Feb 20, 2020
Embed
What would you like to do?
terminator=$(mktemp --dry-run /tmp/terminator.XXX)
echo "touch $terminator to stop"
(
while true; do
if [[ -f "$terminator" ]]; then
kill "$CHILD_PID"
echo "Killed $CHILD_PID because the main container terminatord."
exit
fi
sleep 1
done
) &
trap "touch $terminator" EXIT
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.