daily pastebin goal
38%
SHARE
TWEET

stijn

a guest Aug 6th, 2009 164 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top