Last active
August 29, 2015 14:05
-
-
Save wangzuo/e2865d190169fd89ba53 to your computer and use it in GitHub Desktop.
switch between nginx and apache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NGINX=$(ps aux | grep -c nginx) | |
| if [ $NGINX -eq 1 ] | |
| then | |
| echo 'stop apache, start nginx'; | |
| sudo apachectl stop; sudo nginx; | |
| else | |
| echo 'stop nginx, start apache'; | |
| sudo nginx -s stop; sudo apachectl start; | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment