From 4d1b198ee085f867c1cb3c2a9e8df04c54b83b6c 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 14:12:22 +0800 Subject: [PATCH] update ubus-status.sh --- configfiles/ubus-status.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/configfiles/ubus-status.sh b/configfiles/ubus-status.sh index 83cb14a..e64dcf5 100644 --- a/configfiles/ubus-status.sh +++ b/configfiles/ubus-status.sh @@ -11,8 +11,6 @@ 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 killall ubusd @@ -23,18 +21,16 @@ do 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 + if [ "$(pgrep ubusd | wc -l)" -eq 0 ]; then /sbin/ubusd & killall rpcd sleep 1 /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30 & fi - if [ -z "$pidv2" ]; then + if [ "$(pgrep rpcd | wc -l)" -eq 0 ]; then /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30 & fi