pm2/test/benchmarks/monit.sh
Peter Dave Hello 5c11598326 fix: remove trailing spaces
Most of the coding style guides ask to remove trailing spaces, also,
current .editorconfig has the same config.
2018-07-02 20:34:28 +08:00

36 lines
508 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