From 5f7bc77ca2fd97bf319de2893c942d62b0f08dd1 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 8 Jul 2013 15:50:50 +0530 Subject: [PATCH] Reload nginx after enable/disable sites --- usr/local/sbin/easyengine | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index d367a167..850ab15a 100755 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -392,6 +392,13 @@ NGINXUSERINFO() || OwnError "Unable To Findout Nginx Username" } +NGINXRELOAD() +{ + # Reload Nginx Configuration + echo -e "\033[34m Reloading Nginx Configuration, Please Wait... \e[0m" + nginx -t && service nginx reload || OwnError "Unable To Reload Nginx" +} + NGINXRESTART() { # Test & Reload Nginx @@ -532,8 +539,7 @@ EEPERMISSION() chown -R $NGINXUSER:$NGINXUSER /var/www/$DOMAIN/ || OwnError "Unable To Change Ownership For $DOMAIN" # Reload Nginx Configuration - echo -e "\033[34m Reloading Nginx Configuration, Please Wait... \e[0m" - nginx -t && service nginx reload || OwnError "Unable To Reload Nginx" + NGINXRELOAD } # NGINX Configuration Function @@ -1445,6 +1451,9 @@ then ln -s /etc/nginx/sites-available/$DOMAIN /etc/nginx/sites-enabled/ \ || OwnError "Unable To Create Symbolic Link For $DOMAIN" + # Reload Nginx Configuration + NGINXRELOAD + elif [ "$2" = "disable" ] then @@ -1458,6 +1467,9 @@ then rm /etc/nginx/sites-enabled/$DOMAIN \ || OwnError "Unable To Remove Symbolic Link For $DOMAIN" + # Reload Nginx Configuration + NGINXRELOAD + #elif [ "$2" = "delete" ] #then