Commit 08553534 authored by nanamicat's avatar nanamicat

docker

parent d6a5273f
#!/bin/bash #!/bin/bash
pid=0 pid=0
down=$(echo "$1" | jq -r '.routers | .[].down')
echo "$down"
run_stop() { run_stop() {
signalCode=$1 signalCode=$1
if [ -n "$DOWN_SCRIPT" ]; then if [ -n "$down" ]; then
eval "$DOWN_SCRIPT" eval "$down"
fi fi
if [ $pid -ne 0 ]; then if [ $pid -ne 0 ]; then
kill "-$signalCode" "$pid" kill "-$signalCode" "$pid"
...@@ -17,7 +18,7 @@ run_stop() { ...@@ -17,7 +18,7 @@ run_stop() {
trap 'kill ${!}; run_stop 2' SIGTERM trap 'kill ${!}; run_stop 2' SIGTERM
trap 'kill ${!}; run_stop 15' SIGINT trap 'kill ${!}; run_stop 15' SIGINT
"$@" & tun "$@" &
pid="$!" pid="$!"
# wait forever # wait forever
......
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