You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
385 B
15 lines
385 B
#!/bin/sh
|
|
# file: nginx/run
|
|
|
|
exec 2>&1
|
|
echo $(realpath $0) started
|
|
|
|
while true; do
|
|
inotifywait -e close_write,moved_to,create,delete /etc/nginx/conf.d
|
|
sleep 5
|
|
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 &
|
|
|
|
exec nginx
|