Polling to check usbus service
This commit is contained in:
@@ -4,11 +4,11 @@ while true
|
||||
do
|
||||
nginx_status=$(/etc/init.d/dbus status | grep -o "running")
|
||||
datetime=$(date +"%Y-%m-%d %H:%M:%S")
|
||||
pid2=$(pgrep "ubusd" | head -n 1)
|
||||
pidv=$(pgrep "ubusd" | head -n 1)
|
||||
|
||||
if [ -n "$nginx_status" ]; then
|
||||
echo "$datetime / Ubus服务正在运行,一切正常。"
|
||||
elif [ -z "$pid2" ]; then
|
||||
elif [ -z "$pidv" ]; then
|
||||
echo "$datetime / Ubus服务异常,正在重启Ubus。"
|
||||
/sbin/ubusd &
|
||||
killall rpcd
|
||||
|
||||
Reference in New Issue
Block a user