nginx/launch
2016-04-20 19:40:22 +02:00

13 lines
350 B
Bash
Executable File

#!/bin/sh
# debug
# set -x
while true; do
inotifywait -e close_write,moved_to,create,delete /etc/nginx/conf.d
sleep 2
echo "INFO: nginx configuration change detected, attempting to load the new configuration ..."
nginx -t && nginx -s reload || echo "ERROR: nginx configuration has problems, thus cannot be reloaded."
done &
/usr/sbin/nginx