update httpubus

This commit is contained in:
桐话
2024-06-20 00:21:12 +08:00
committed by GitHub
parent fdb95994e5
commit 1ebdae0629
+21 -4
View File
@@ -3,14 +3,31 @@
START=99
STOP=11
board_name() {
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
}
check_model() {
local board=$(board_name)
case "$board" in
jp,tvbox|\
panther,x2)
/sbin/ubus-status.sh > /dev/null 2>&1 &
;;
*)
return 1
;;
esac
}
start() {
/sbin/ubus-status.sh > /dev/null 2>&1 &
check_model
}
stop() {
pid=$(pgrep "ubus-status" | head -n 1)
if [ -n "$pid" ]; then
kill -9 "$pid"
pidcount=$(pgrep "ubus-status" | wc -l)
if [ "$pidcount" -eq 1 ]; then
killall -9 ubus-status
fi
}