2006-03-27 05:37:27 +02:00
|
|
|
#!/bin/csh
|
2009-11-04 19:30:18 +01:00
|
|
|
|
|
|
|
# Pandora FMS IPSO/BSD, startup script
|
|
|
|
# Copyright (c) 2006-2009 Artica ST, <info@artica.es>
|
|
|
|
# IPSO/BSD (csh)
|
|
|
|
# v1.2 Build 091104
|
|
|
|
# http://www.pandorafms.com
|
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2007-08-01 20:32:34 +02:00
|
|
|
set PANDORA_PATH=/opt/pandora_agent
|
2006-03-27 05:37:27 +02:00
|
|
|
set DAEMON=pandora_agent.sh
|
|
|
|
set PIDFILE=/var/run/pandora.pid
|
|
|
|
test -x $PANDORA_PATH/$DAEMON || exit
|
|
|
|
|
|
|
|
switch ($1)
|
|
|
|
case start:
|
|
|
|
if ( -e $PIDFILE ) then
|
|
|
|
echo "Pandora Agent is currently running on this machine. Aborting now..."
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
nice -10 $PANDORA_PATH/$DAEMON $PANDORA_PATH & set MYPID=$!
|
|
|
|
echo $MYPID > /var/run/pandora.pid
|
|
|
|
echo "Pandora Agent is now running with PID $MYPID"
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
breaksw
|
|
|
|
case stop:
|
|
|
|
if ( -f $PIDFILE ) then
|
|
|
|
echo "Stopping Pandora Agent."
|
|
|
|
kill -9 `cat $PIDFILE`
|
|
|
|
rm $PIDFILE
|
|
|
|
else
|
|
|
|
echo "Pandora Agent is not running, cannot stop it. Aborting now..."
|
|
|
|
endif
|
|
|
|
breaksw
|
|
|
|
case restart:
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
breaksw
|
|
|
|
default:
|
2009-11-04 19:30:18 +01:00
|
|
|
echo "Usage: ./pandora_agent {start|stop|restart|force-reload}"
|
2006-03-27 05:37:27 +02:00
|
|
|
breaksw
|
|
|
|
|
|
|
|
endsw
|