From ba8bc77c3c103c14f650a5b388f5b4bf1cedc0ce 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 12:07:15 +0800 Subject: [PATCH] update ubus-status.sh --- configfiles/ubus-status.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configfiles/ubus-status.sh b/configfiles/ubus-status.sh index 94ed9af..83cb14a 100644 --- a/configfiles/ubus-status.sh +++ b/configfiles/ubus-status.sh @@ -10,16 +10,23 @@ do datetime=$(date +"%Y-%m-%d %H:%M:%S") pidcount=$(pgrep "ubusd" | wc -l) + pidcount2=$(pgrep "rpcd" | wc -l) pidv=$(pgrep "ubusd" | head -n 1) pidv2=$(pgrep "rpcd" | head -n 1) - if [ $pidcount -gt 1 ]; then + if [ "$pidcount" -gt 1 ]; then killall ubusd killall rpcd sleep 1 /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30 & fi + if [ "$pidcount2" -gt 1 ] && [ "$pidcount" -eq 1 ]; then + killall rpcd + sleep 1 + /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30 & + fi + if [ -z "$pidv" ]; then /sbin/ubusd & killall rpcd