mirror of
https://github.com/GRFreire/nthmail.git
synced 2026-01-09 12:59:38 +00:00
fix run-web.sh to not leave any process hanging
This commit is contained in:
parent
bf21d05b6d
commit
f1190e9892
@ -15,7 +15,11 @@ run_server() {
|
||||
ts="$(get_ts)"
|
||||
run_server
|
||||
|
||||
trap "kill -s KILL $pid; trap - EXIT; exit" EXIT INT HUP
|
||||
k() {
|
||||
kill -s KILL $pid
|
||||
}
|
||||
|
||||
trap "k; trap - EXIT; exit 0" EXIT INT HUP
|
||||
|
||||
while true; do
|
||||
sleep 1;
|
||||
@ -24,7 +28,7 @@ while true; do
|
||||
ts="$new_ts"
|
||||
echo ""
|
||||
if [ "$pid" != "0" ]; then
|
||||
kill -s KILL $pid
|
||||
k
|
||||
fi
|
||||
run_server
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user