#!/usr/local/bin/perl #This is the script for stopping, starting and restarting a server #noexec #I am assuming that you are using the COP3832/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. $server = $ENV{HOME} . "/COP3832/server"; $command = "/depot/http/bin/httpd -d"; if (@ARGV == 0 || @ARGV > 1) { 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 <