#!/bin/bash # Pandora FMS Recon Server, startup script # Sancho Lerena, # SLES Version # v2.0 build 081111 # Configurable path and filenames PANDORA_HOME="/etc/pandora/pandora_server.conf" PANDORA_DAEMON=/usr/local/bin/pandora_recon # Main script if [ ! -f $PANDORA_DAEMON ] then echo "Pandora FMS Recon Server not found, please check setup and read manual" exit fi case "$1" in start) PANDORA_PID=$(pidof -x $PANDORA_DAEMON) if [ ! -z $PANDORA_PID ] then echo "Pandora FMS Recon Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..." exit 1 fi $PANDORA_DAEMON $PANDORA_HOME -D sleep 1 PANDORA_PID=$(pidof -x $PANDORA_DAEMON) if [ ! -z "$PANDORA_PID" ] then echo "Pandora Recon Server is now running with PID $PANDORA_PID" else echo "Cannot start Pandora FMS Recon Server. Aborted." fi ;; stop) PANDORA_PID=$(pidof -x $PANDORA_DAEMON) if [ -z $PANDORA_PID ] then echo "Pandora FMS Recon Server is not running, cannot stop it." exit 1 else echo "Stopping Pandora FMS Recon Server" kill $PANDORA_PID > /dev/null 2>&1 fi ;; force-reload|restart) $0 stop sleep 10 $0 start ;; *) echo "Usage: pandora_recon {start|stop|restart}" exit 1 esac