Last active
January 2, 2016 21:49
-
-
Save mafikes/8366441 to your computer and use it in GitHub Desktop.
Bash script for manage nginx, mysql server, php-fpm
This file contains 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
#!/bin/bash | |
# WEBSERVER / Webserver.sh | |
# By Martin Antoš, mafikes.cz | |
# Script for manage nginx, mysql, php | |
# | |
# FUNCTION | |
# | |
start() { | |
echo -e "\n [Webserver]: Starting nginx..." | |
sudo nginx | |
echo -e "\n [Webserver]: Starting mysql..." | |
mysql.server start | |
echo -e "\n [Webserver]: Starting php-fpm..." | |
sudo php-fpm | |
} | |
stop() { | |
echo -e "\n [Webserver]: Stopping nginx..." | |
sudo nginx -s stop | |
echo -e "\n [Webserver]: Stopping mysql..." | |
mysql.server stop | |
echo -e "\n [Webserver]: Stopping php-fpm..." | |
sudo killall php-fpm | |
} | |
# | |
# MAIN | |
# | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart}" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment