mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-02-03 12:27:44 +01:00
Instead of running a second instance of testnet once and in parallel with the background task on interface up/down, the background task is woken up. The avoids the potential for a race where under certain circumstances a ubus event for internet up or down may never be sent. Also remove unused include and add missing quotation.
23 lines
411 B
Bash
Executable file
23 lines
411 B
Bash
Executable file
#!/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() {
|
|
procd_send_signal testnet
|
|
}
|