Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Start Apache and/or Mysql server
- apache=/etc/init.d/apache2
- mysql=/etc/init.d/mysql
- case $1 in
- "start")
- if [ "$2" = "apache" ] || [ "$3" = "apache" ] ; then
- gksudo $apache start &> /dev/null
- echo "Apache started!"
- fi
- if [ "$2" = "mysql" ] || [ "$3" = "mysql" ] ; then
- gksudo $mysql start &> /dev/null
- echo "Mysql started!"
- fi;;
- "stop")
- if [ "$2" = "apache" ] || [ "$3" = "apache" ] ; then
- gksudo $apache stop &> /dev/null
- echo "Apache stopped!"
- fi
- if [ "$2" = "mysql" ] || [ "$3" = "mysql" ] ; then
- gksudo $mysql stop &> /dev/null
- echo "Mysql stopped!"
- fi;;
- *)
- echo "Usage: lamp.sh start|stop apache mysql";;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement