update ubus-status.sh

This commit is contained in:
桐话
2024-06-18 14:12:22 +08:00
committed by GitHub
parent ba8bc77c3c
commit 4d1b198ee0
+2 -6
View File
@@ -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