#!/bin/sh

# PROVIDE: lprng
# REQUIRE: LOGIN
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# lprng_enable (bool): Set to NO by default.
#                      Set it to YES to enable lprng.
#

. /etc/rc.subr

name="lprng"
rcvar=${name}_enable

command=/usr/local/sbin/lpd

required_files="/etc/printcap /usr/local/etc/lpd.conf /usr/local/etc/lpd.perms"

start_precmd=start_precmd

start_precmd()
{
	if checkyesno lpd_enable; then
		warn "lpd must be disabled"
		return 1
	fi

	/usr/local/sbin/checkpc -f
}

load_rc_config $name

: ${lprng_enable="NO"}

run_rc_command "$1"
