#!/bin/sh
#
# $FreeBSD: ports/print/pips800/files/ekpd.sh,v 1.3 2006/02/20 20:47:36 dougb Exp $
#

# PROVIDE: ekpd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Define these ekpd_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/ekpd
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
ekpd_enable=${ekpd_enable:-"NO"}		# Enable ekpd
ekpd_flags=${ekpd_flags:-""}			# Flags to ekpd program

. /etc/rc.subr

name="ekpd"
rcvar=`set_rcvar`
command="/usr/local/libexec/pips/printer/ekpd"
start_precmd="ekpd_prestart"

ekpd_prestart() {
	OLDMASK=`umask`
	umask 000
	[ ! -d /var/ekpd ] && mkdir -p /var/ekpd && chmod 1777 /var/ekpd
	[ ! -e /var/ekpd/ekplp0 ] && rm -f /var/ekpd/ekplp0 && \
		mkfifo -m 666 /var/ekpd/ekplp0
	umask $OLDMASK
}

load_rc_config $name
run_rc_command "$1"
