diff --git a/starter b/starter index 9f6a344..12927d7 100755 --- a/starter +++ b/starter @@ -1,8 +1,13 @@ #!/usr/bin/env bash set -e + nginx -t nginx -g 'daemon off;' & nginx_pid=$! + +trap 'kill "$nginx_pid"' EXIT +trap 'kill "$nginx_pid"' SIGTERM + function checkIsUpToDate() { git fetch git rev-list HEAD...origin/master --count | grep -q "^0$" && { @@ -32,4 +37,12 @@ update ) & +( + while true; do + sleep 1h + update + + done +) & + wait "$nginx_pid"