From 0c22e184e6547f876d1b05b99317d281583f9d1b Mon Sep 17 00:00:00 2001 From: fbt Date: Tue, 15 Sep 2015 12:22:37 +0300 Subject: [PATCH] conftest --- init.d/nginx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.d/nginx b/init.d/nginx index 2b0e9ad..31c901b 100755 --- a/init.d/nginx +++ b/init.d/nginx @@ -3,10 +3,14 @@ service_command='/usr/bin/nginx' service_pidfile='/run/nginx.pid' -nginx.test_config() { "$service_command" -tq; } +nginx.test_config() { "$service_command" -t "$@"; } + +conftest() { + nginx.test_config +} reload() { - nginx.test_config || { + nginx.test_config -q || { watchman.err "Nginx config test failed, not reloading." return 1 } @@ -15,7 +19,7 @@ reload() { } restart() { - nginx.test_config || { + nginx.test_config -q || { watchman.err "Nginx config test failed, not restarting." return 1 }