#!/sbin/openrc-run
supervisor=supervise-daemon

command="/usr/bin/speedtest_exporter"
command_args="-web.listen-address=$speedtest_exporter_listen_address"
command_user="prometheus:prometheus"

error_log="/var/log/${SVCNAME}.log"

healthcheck_timer=60
healthcheck_delay=60
respawn_delay=60
respawn_max=0

depend() {
	need net
	after firewall
}

healthcheck() {
	netstat -tulpn | grep $speedtest_exporter_listen_address
}

start_pre() {
	checkpath -f -o $command_user -m644 $error_log
}
