mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-06 08:26:50 +01:00
1d0e69e3a5
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
67 lines
899 B
Bash
67 lines
899 B
Bash
#!/bin/bash
|
|
#
|
|
# Init file for Monit process monitor.
|
|
#
|
|
# Written by Dag Wieers <dag@wieers.com>.
|
|
# Adapted for Slackware by Eric Hameleers <alien@slackware.com>
|
|
#
|
|
|
|
### Default variables
|
|
CONFIG="/etc/monitrc"
|
|
|
|
[ -x /usr/bin/monit ] || exit 1
|
|
[ -r "$CONFIG" ] || exit 1
|
|
|
|
RETVAL=0
|
|
prog="monit"
|
|
desc="Process Monitor"
|
|
|
|
start() {
|
|
echo "Starting $desc ($prog): /etc/rc.d/rc.$prog start"
|
|
$prog -c $CONFIG
|
|
return $?
|
|
}
|
|
|
|
stop() {
|
|
echo "Shutting down $desc ($prog)..."
|
|
$prog -c $CONFIG quit
|
|
return $?
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
sleep 2
|
|
start
|
|
}
|
|
|
|
reload() {
|
|
echo "Reloading $desc ($prog)"
|
|
$prog -c $CONFIG reload
|
|
return $?
|
|
}
|
|
|
|
status() {
|
|
$prog -c $CONFIG status
|
|
return $?
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
restart
|
|
;;
|
|
reload)
|
|
reload
|
|
;;
|
|
status)
|
|
status
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload|status}"
|
|
esac
|
|
|