#!/bin/sh

# $FreeBSD: graphics/sane-backends/files/saned.in 300896 2012-07-14 13:54:48Z beat $
#
# PROVIDE: saned
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable saned:
#	saned_enable="YES"

. /etc/rc.subr

name=saned
rcvar=saned_enable

load_rc_config saned

: ${saned_enable:="NO"}
: ${saned_uid:="saned"}

command="/usr/local/sbin/saned"

start_precmd=saned_prestart

saned_prestart()
{
	case "${saned_flags}" in
	*-a\ *) err 1 'saned_flags includes the -a option. Please use saned_uid instead' ;;
	esac
}

command_args="-a $saned_uid"

run_rc_command "$1"
