Advertisement
Guest User

stijn

a guest
Aug 6th, 2009
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Start Apache and/or Mysql server
  4.  
  5. apache=/etc/init.d/apache2
  6. mysql=/etc/init.d/mysql
  7.  
  8. case $1 in
  9.     "start")
  10.         if [ "$2" = "apache" ] || [ "$3" = "apache" ] ; then
  11.             gksudo $apache start &> /dev/null
  12.             echo "Apache started!"
  13.         fi
  14.         if [ "$2" = "mysql" ] || [ "$3" = "mysql" ] ; then
  15.             gksudo $mysql start &> /dev/null
  16.             echo "Mysql started!"
  17.         fi;;
  18.     "stop")
  19.         if [ "$2" = "apache" ] || [ "$3" = "apache" ] ; then
  20.             gksudo $apache stop &> /dev/null
  21.             echo "Apache stopped!"
  22.         fi
  23.         if [ "$2" = "mysql" ] || [ "$3" = "mysql" ] ; then
  24.             gksudo $mysql stop &> /dev/null
  25.             echo "Mysql stopped!"
  26.         fi;;
  27.     *)
  28.         echo "Usage: lamp.sh start|stop apache mysql";;
  29. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement