From e12a280b2b6799309f61027dad50b7346027c129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=90=E8=AF=9D?= <49544781+xiaomeng9597@users.noreply.github.com> Date: Mon, 10 Jun 2024 04:45:23 +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 c67a901..8a2f703 100644 --- a/configfiles/ubus-status.sh +++ b/configfiles/ubus-status.sh @@ -2,11 +2,11 @@ while true do - nginx_status=$(/etc/init.d/dbus status | grep -o "running") + dbus_status=$(/etc/init.d/dbus status | grep -o "running") datetime=$(date +"%Y-%m-%d %H:%M:%S") pidv=$(pgrep "ubusd" | head -n 1) - if [ -n "$nginx_status" ]; then + if [ -n "$dbus_status" ]; then echo "$datetime / Ubus服务正在运行,一切正常。" elif [ -z "$pidv" ]; then echo "$datetime / Ubus服务异常,正在重启Ubus。"