From 6a168c8d01b21b2dd45168ddd7cafa4a7babd717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=90=E8=AF=9D?= <49544781+xiaomeng9597@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:13:11 +0800 Subject: [PATCH] Polling to check usbus service --- configfiles/ubus-status.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configfiles/ubus-status.sh b/configfiles/ubus-status.sh index 083f87d..c67a901 100644 --- a/configfiles/ubus-status.sh +++ b/configfiles/ubus-status.sh @@ -4,11 +4,11 @@ while true do nginx_status=$(/etc/init.d/dbus status | grep -o "running") datetime=$(date +"%Y-%m-%d %H:%M:%S") - pid2=$(pgrep "ubusd" | head -n 1) + pidv=$(pgrep "ubusd" | head -n 1) if [ -n "$nginx_status" ]; then echo "$datetime / Ubus服务正在运行,一切正常。" - elif [ -z "$pid2" ]; then + elif [ -z "$pidv" ]; then echo "$datetime / Ubus服务异常,正在重启Ubus。" /sbin/ubusd & killall rpcd