#!/sbin/openrc-run

name="raspiwhep"
description="Ultra low latency video streams from a Raspberry Pi"

: "${command_user:="raspiwhep"}"

command="/usr/bin/raspiwhep"
: "${command_args:=""}"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"

export LD_LIBRARY_PATH=/opt/vc/lib/

depend() {
	need net
	after firewall
}

start_pre() {
	if [ -n "$output_log" ]; then
		checkpath -f -o "$command_user" "$output_log"
	fi

	if [ -n "$error_log" ]; then
		checkpath -f -o "$command_user" "$error_log"
	fi
}
