pm2/test/benchmarks/monit.sh
2014-08-22 14:16:40 -04:00

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