Commit 5a0ace5d authored by nanamicat's avatar nanamicat

docker

parent d70d4b10
#!/bin/bash
pid=0
run_stop() {
signalCode=$1
if [ -n "$DOWN_SCRIPT" ]; then
eval "$DOWN_SCRIPT"
fi
if [ $pid -ne 0 ]; then
kill "-$signalCode" "$pid"
wait "$pid"
fi
exit $((128 + signalCode));
}
trap 'kill ${!}; run_stop 2' SIGTERM
trap 'kill ${!}; run_stop 15' SIGINT
"$@" &
pid="$!"
# wait forever
wait "$pid"
pid=0
run_stop 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment