From 803d9b69ba27f387149edec7e891200f7dd105d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=90=E8=AF=9D?= <49544781+xiaomeng9597@users.noreply.github.com> Date: Sun, 9 Jun 2024 16:41:09 +0800 Subject: [PATCH] Polling to check usbus service --- configfiles/httpubus | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 configfiles/httpubus diff --git a/configfiles/httpubus b/configfiles/httpubus new file mode 100644 index 0000000..a0a82e3 --- /dev/null +++ b/configfiles/httpubus @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=11 + +start() { + /sbin/ubus-status.sh > /dev/null 2>&1 & +} + +stop() { + pid=$(pgrep "ubus-status" | head -n 1) + if [ -n "$pid" ]; then + kill -9 "$pid" + fi +} + +restart() { + stop + start +}