Making a shell script to enable/disable apache/mysql
I have my own website that hosted remotely, but I like to test out my scripts locally before I upload them.
I would like to make a shell script that acts like an on/off switch for apache/mysql. something like this psuedocode: if ( apache and mysql are running ) turn them off else turn them on I know there's a way to do it, but I forgot almost everything from my Linux class. So how would I go about making the script? |
Scripts like that already exist on your Linux system in /etc/init.d.
|
The rc.mysql start/stop script (in /etc/init.d) should have been created when you installed mysql on the server. If it doesn't exist, I can send you mine, but you're going to have to modify the variables in it to point to the location where you installed it.
As for apache, the file should be called rc.httpd. |
All times are GMT -5. The time now is 10:50 PM. |