Procd support

This commit is contained in:
gSpot
2024-12-16 21:10:49 +03:00
parent be3b7e7dd2
commit e0e13d4962
7 changed files with 36 additions and 29 deletions

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector
PKG_VERSION:=1.3.0
PKG_VERSION:=1.3.1
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -3,16 +3,19 @@
START=97
STOP=01
USE_PROCD=1
PROG="/usr/bin/internet-detector"
run_instance() {
config_get enabled "$1" enabled "0"
if [ $enabled = "1" ]; then
$PROG service "$1"
procd_open_instance "$1"
procd_set_param command "$PROG" "nodaemon" "$1"
procd_close_instance
fi
}
start() {
start_service() {
config_load internet-detector
config_get mode "config" mode "0"
if [ $mode = "1" ]; then
@@ -20,6 +23,15 @@ start() {
fi
}
stop() {
stop_service() {
$PROG stop
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "internet-detector"
}