#!/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
}
