#!/bin/sh
#
# $NetBSD: gerbera.sh,v 1.3 2024/07/10 06:17:17 wiz Exp $
#

# PROVIDE: gerbera
# REQUIRE: DAEMON

$_rc_subr_loaded . /etc/rc.subr

name="gerbera"
rcvar=$name
load_rc_config_var gerbera_username gerbera_username
command="/usr/pkg/bin/gerbera"
logfile="/var/log/${name}.log"
pidfile="/var/gerbera/${name}.pid"
command_args="-d -u ${gerbera_username:-gerbera} -m /var/gerbera -P ${pidfile} -l ${logfile} -c /usr/pkg/etc/gerbera/config.xml"

if [ -f /etc/rc.subr ]; then
	load_rc_config $name
	run_rc_command "$1"
else
	echo -n "${name}"
	${command} ${gerbera_flags} ${command_args}
fi
