update ubus-status.sh

This commit is contained in:
桐话
2024-06-18 12:07:15 +08:00
committed by GitHub
parent 104f48d3b1
commit ba8bc77c3c
+8 -1
View File
@@ -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