mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
36 lines
512 B
Bash
Executable File
36 lines
512 B
Bash
Executable File
#!/bin/bash
|
|
|
|
RESULT_FILE=result.monit
|
|
|
|
export RESULT_FILE=$RESULT_FILE
|
|
|
|
launch() {
|
|
echo "========= `date`" >> $RESULT_FILE
|
|
nohup ./monit-daemon.sh &> monit.log &
|
|
}
|
|
|
|
ppkill() {
|
|
pkill -f monit-daemon.sh ; pkill -f sleep
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
launch
|
|
;;
|
|
kill)
|
|
ppkill
|
|
;;
|
|
stop)
|
|
ppkill
|
|
;;
|
|
restart)
|
|
ppkill
|
|
launch
|
|
;;
|
|
*)
|
|
echo "Usage: {start|kill|stop|restart}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
exit $RETVAL
|