23 lines
361 B
Bash
Executable file
23 lines
361 B
Bash
Executable file
#!/bin/bash
|
|
|
|
function invoke() {
|
|
/nginx/objs/nginx \
|
|
-p /tmp \
|
|
-e /tmp/error.log \
|
|
-c /nginx.conf \
|
|
-g "daemon off;" \
|
|
$@
|
|
}
|
|
|
|
function sigint_handler() {
|
|
echo "sigint received. trigger again to kill."
|
|
invoke -s quit
|
|
trap - INT
|
|
}
|
|
|
|
trap 'sigint_handler' INT
|
|
|
|
invoke &
|
|
wait
|
|
echo "NGINX down. waiting until signalled..."
|
|
sleep infinity
|