====== Stop and start Apache instances ====== #!/bin/bash #Start and Stop Apache #written Andrew Stringer Feb 2011 #Get action to perform from 1st command line argument ACTION=${1} #This must be run as user web. if [ "${USER}" = "web" ]; then #echo "Running as user web" #echo " " #do something to keep if happy DUMMY=0 else echo "Sorry, you need to be the web user to run this script." exit 1 fi echo "This will stop or start all running instances of apache on this server." echo "If you want to restart an individual web server DO NOT USE THIS!!!! Press Ctrl-c NOW!" sleep 10 if [ "${ACTION}" = "start" ]; then echo "Starting Apache instances" elif [ "${ACTION}" = "stop" ]; then echo "Stopping Apache instances" else echo "No parameter passed, Useage:- startstopapache.sh start|stop" exit 2 fi #Start app starts or stops for CASINO in cas1 cas2 cas3 cas4 do echo "Casino is ${CASINO}, acton is ${ACTION}" /wworks/casino/${CASINO}/prod/apache/bin/run_apache.bash ${ACTION} done exit 0