This commit is contained in:
Jack L. Frost 2015-09-15 12:22:37 +03:00
parent 3d5a93b86e
commit 0c22e184e6
1 changed files with 7 additions and 3 deletions

View File

@ -3,10 +3,14 @@
service_command='/usr/bin/nginx' service_command='/usr/bin/nginx'
service_pidfile='/run/nginx.pid' service_pidfile='/run/nginx.pid'
nginx.test_config() { "$service_command" -tq; } nginx.test_config() { "$service_command" -t "$@"; }
conftest() {
nginx.test_config
}
reload() { reload() {
nginx.test_config || { nginx.test_config -q || {
watchman.err "Nginx config test failed, not reloading." watchman.err "Nginx config test failed, not reloading."
return 1 return 1
} }
@ -15,7 +19,7 @@ reload() {
} }
restart() { restart() {
nginx.test_config || { nginx.test_config -q || {
watchman.err "Nginx config test failed, not restarting." watchman.err "Nginx config test failed, not restarting."
return 1 return 1
} }