From c3d0a9485060ce6fcfe71be250d177b1796c2c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=90=E8=AF=9D?= <49544781+xiaomeng9597@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:12:14 +0800 Subject: [PATCH] update ubus-status.sh --- configfiles/ubus-status.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configfiles/ubus-status.sh b/configfiles/ubus-status.sh index e64dcf5..123b9d7 100644 --- a/configfiles/ubus-status.sh +++ b/configfiles/ubus-status.sh @@ -30,11 +30,10 @@ do /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30 & fi - if [ "$(pgrep rpcd | wc -l)" -eq 0 ]; then + if [ "$(pgrep rpcd | wc -l)" -eq 0 ] && [ "$pidcount" -eq 1 ]; then + echo "$datetime / Ubus服务异常,正在重启Ubus。" /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30 & - fi - - if [[ "$status_code" == 500 || "$status_code" == 502 ]] && echo "$dbus_status" | grep -q "running"; then + elif [[ "$status_code" == 500 || "$status_code" == 502 ]] && echo "$dbus_status" | grep -q "running"; then echo "$datetime / Ubus服务异常,正在重启Ubus。" killall rpcd sleep 1