#!/bin/csh -f ############################################################################# # # This script starts the env_log script in the background. # # Author: James Brewer # Version: 1.0 Date: Oct.05, 1998 ############################################################################# # # Check script arguments... # if(($#argv != 0 && $#argv != 1) || $1 == -help) then echo "Usage: $0 [-q] [-help]" echo " -q: Work in quiet mode" echo " -help: gives this help" exit(-1) endif # Use absolute name so no problems with other users... set script = /home/meteolog/scripts/env_log.csh # Don't start if already running! set exist = `ps -ef | grep $script | grep -v grep | wc -l` if($exist != 0) then if ($1 != "-q") then ps -ef | grep $script | grep -v grep echo "Program already running? Exiting..." endif exit(-1) endif if ($1 != "-q") then echo " Starting $script in background..." endif $script >& /dev/null & exit (0)