#!/bin/sh
#
# p910nd:	Start stop p910nd
# description:	This shell script takes care of starting and stopping
#               p910nd (port 9100+n printer daemon)
#		This script only controls the one on port 9100
#		You can start others if you wish.
# chkconfig:    2345 90 10
#

. /etc/init.d/functions

# default options
P910ND="-f /dev/usb/lp0"

# custom config
[ -f /etc/sysconfig/p910nd ] && . /etc/sysconfig/p910nd

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting p910nd: "
	# default port is 1 so it will appear as p9101d on a ps
	daemon p910nd $P910ND
	echo
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down p910nd: "
	killproc p9100d
	echo
	rm -f /var/run/p9101.pid
        ;;
  status)
	status p9100d
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: p910nd {start|stop|restart|status}"
	exit 1
esac

exit 0
