[added] simple watchdog script
1 parent 2db367d commit c427d3758afef276eb8173dec7a41da6f3fb4e8c
@ckl ckl authored on 18 Sep 2015
Showing 1 changed file
View
21
scripts/watchdog_monitord.sh 0 → 100644
#!/bin/bash
# watchdog script for monitord
# add this script to your crontab by using `crontab -e`
 
# "monitord status" returns 0 if it is not running
/etc/init.d/monitord status >> /dev/null
 
 
# try to restart
if [ $? -ne 0 ]
then
echo "not running... trying to restart"
/etc/init.d/monitord start
 
if [ $? -ne 0 ]
then
echo "failed!"
fi
fi