#!/usr/local/bin/perl #This is the script for stopping, starting and restarting a server #noexec #I am assuming that you are using the CGS4825/server directory as #the server root. I am also assuming that this directory is #located in your root or HOME directory. If this is not the #case then change the following variable so that it contains #the full path to your server root. print "Version 2\n"; $server_ext = ""; if (@ARGV == 2) { $server_ext = ".$ARGV[1]"; } $server = $ENV{HOME} . "/cgs4825/server$server_ext"; $command = "/home/ocelot/aul-user-web/bin/httpd -d"; $ps_com = "/bin/ps"; if (@ARGV == 0 || @ARGV > 2) { usage(); } else { ($pid_good,$pid) = test_pid(); $option = $ARGV[0]; if ($option =~ /^hup$/i) { do_hup(); } elsif ($option =~ /^start$/i) { `$command $server`; do_info(); } elsif ($option =~ /^stop$/i) { do_stop(); } elsif ($option =~ /^pid$/i) { do_pid(); } elsif ($option =~ /^info$/i) { do_info(); } else { usage(); } } sub usage() { print <