From bcc28451682b242acbdfbda315a68ba19f5d95da Mon Sep 17 00:00:00 2001 From: ep1088 Date: Mon, 22 Aug 2022 10:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E5=88=86=E9=92=9F=E6=A3=80=E6=B5=8Bgo?= =?UTF-8?q?found=E8=BF=90=E8=A1=8C=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gofound.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gofound.sh 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