mirror of
https://github.com/gSpotx2f/luci-app-internet-detector.git
synced 2025-12-06 11:36:49 +03:00
Procd support
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user