diff --git a/gofound.sh b/gofound.sh new file mode 100644 index 0000000..31a87e2 --- /dev/null +++ b/gofound.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#每分钟检测gofound运行 +#*/1 * * * * /data/gofound/gofound.sh > /dev/null 2>&1 + +count=`ps -fe |grep "gofound"|grep "config.yaml" -c` + +echo $count +if [ $count -lt 1 ]; then + echo "restart" + echo $(date +%Y-%m-%d_%H:%M:%S) >/data/gofound/restart.log + /etc/init.d/gofound.d restart +else + echo "is running" +fi \ No newline at end of file