From bcccd80ba7c02face3745b52a6abe839a0e9ad2e Mon Sep 17 00:00:00 2001 From: fbt Date: Tue, 15 Sep 2015 12:25:58 +0300 Subject: [PATCH] indentation and cleaner code --- init.d/nginx | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/init.d/nginx b/init.d/nginx index 31c901b..6ea7078 100755 --- a/init.d/nginx +++ b/init.d/nginx @@ -10,21 +10,16 @@ conftest() { } reload() { - nginx.test_config -q || { - watchman.err "Nginx config test failed, not reloading." - return 1 - } - - watchman.reload + if nginx.test_config -q; then + watchman.reload + else + watchman.err "Nginx config test failed, not reloading." + return 1 + fi } restart() { - nginx.test_config -q || { - watchman.err "Nginx config test failed, not restarting." - return 1 - } - - stop; start + stop && start } upgrade() {