From bc1b82762dd4a6840c2d628f8043ac6b47462a7c Mon Sep 17 00:00:00 2001 From: Hakase Date: Mon, 1 Apr 2019 00:17:08 +0900 Subject: [PATCH] Update auto.sh --- auto.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/auto.sh b/auto.sh index 48ec166..717a5da 100755 --- a/auto.sh +++ b/auto.sh @@ -170,6 +170,12 @@ mkdir -p ${NGX_LIB} ### Check for old files if [ -f "${NGX_SBIN_PATH}.old" ]; then + ### Test nginx configuration. + "$NGX_SBIN_PATH" -t > /dev/null 2>&1 + if test $? -ne 0; then + echo "Failed nginx configuration test." + exit 1 + fi sleep 1 rm ${NGX_SBIN_PATH}.old systemctl restart nginx