#!/bin/sh

# PROVIDE: authelia
# REQUIRE: DAEMON
# KEYWORD: shutdown

if [ -f /etc/rc.subr ]; then
	. /etc/rc.subr
fi

name="authelia"
rcvar=$name
authelia_user="authelia"
authelia_group="authelia"
command="/usr/pkg/bin/authelia"
command_args="--config /usr/pkg/etc/authelia.yml < /dev/null > /dev/null 2>&1 &"

if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
	load_rc_config $name
	run_rc_command "$1"
else
	if [ -f /etc/rc.conf ]; then
		. /etc/rc.conf
	fi
	echo "$0: No support for non-rc.subr pkgsrc installations. Patches welcome."
	exit 1
fi
