39 lines
655 B
Bash
Executable File
39 lines
655 B
Bash
Executable File
#! /bin/sh
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: monithor-c
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop:
|
|
# Short-Description: MoniThor Server
|
|
### END INIT INFO
|
|
|
|
set -e
|
|
|
|
test -x /usr/local/bin/monithor-client || exit 0
|
|
|
|
umask 022
|
|
|
|
|
|
case "$1" in
|
|
start)
|
|
if [ ! -z "$(ps axf| grep monithor-client | grep -v grep)" ]
|
|
then
|
|
logger "monithor-client is running ..."
|
|
exit
|
|
else
|
|
logger "Starting MoniThor Server"
|
|
/usr/local/bin/monithor-client start
|
|
fi
|
|
;;
|
|
stop)
|
|
logger "Stoping MoniThor server" "monithor-c" || true
|
|
/usr/local/bin/monithor-client stop
|
|
;;
|
|
|
|
*)
|
|
echo "Usage: /etc/init.d/monithor-c {start|stop|status}" || true
|
|
exit 1
|
|
esac
|
|
|
|
exit 0
|