mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
testnet: start from init script and add missing dependency
This commit is contained in:
parent
0a1bf10fc3
commit
75117cba49
3 changed files with 25 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||||
define Package/testnet
|
define Package/testnet
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
TITLE:=Check WAN IP Connection
|
TITLE:=Check WAN IP Connection
|
||||||
|
DEPENDS:=+ndisc6
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/testnet/description
|
define Package/testnet/description
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,4 @@ interface_check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface_check
|
interface_check
|
||||||
if [ -n "$(pgrep -f testnet)" ]; then
|
/etc/init.d/testnet reload
|
||||||
testnet once
|
|
||||||
else
|
|
||||||
testnet &
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
23
testnet/files/etc/init.d/testnet
Executable file
23
testnet/files/etc/init.d/testnet
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=21
|
||||||
|
STOP=10
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
TESTNET=$(which testnet)
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
# do not start testnet if the feature is explicitly disabled
|
||||||
|
[ "$(uci -q get testnet.global.enabled)" = "0" ] && return 0
|
||||||
|
|
||||||
|
[ -n "$TESTNET" ] && {
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$TESTNET"
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
|
[ -n "$TESTNET" ] && procd_running testnet && "$TESTNET" once
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue