#!/sbin/openrc-run

# Sample init.d file for alpine linux.

name=opentracker
daemon=/usr/bin/$name
conf=${opentracker_conf:-/etc/opentracker/opentracker.conf}
pidfile=/var/run/opentracker.pid

depend() {
	need net
	after firewall
}

start() {
	ebegin "Starting ${name}"
	start-stop-daemon --start --quiet \
		--make-pidfile \
		--pidfile ${pidfile} \
		--background \
		--stdout /dev/null \
		--stderr /dev/null \
		--exec ${daemon} \
		-- \
		-d /var/empty \
		-f $conf \
		-u ${opentracker_user:-opentracker} \
		${opentracker_opts}
	eend $?
}

stop() {
	ebegin "Stopping ${name}"
	start-stop-daemon --stop --quiet --pidfile ${pidfile} \
		--exec ${daemon}
	eend $?
}

