#!/bin/sh
#
# Start the printer daemon.

set -e

test -f /usr/sbin/lpd || exit 0

case "$1" in
  start)
	echo -n "Starting printer spooler: lpd"
	start-stop-daemon --start --quiet --exec /usr/sbin/lpd
	echo "."
	;;
  stop)
	echo -n "Stopping printer spooler: lpd"
	start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/lpd
	echo "."
	;;
  reload|force-reload)
	echo -n "Reloading printer spooler configuration..."
	start-stop-daemon --stop --quiet --oknodo --signal 1 --exec /usr/sbin/lpd
	echo "done."
	;;
  restart)
	echo -n "Restarting printer spooler..."
	start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/lpd
	start-stop-daemon --start --quiet --exec /usr/sbin/lpd
	echo "done."
	;;
  *)
        echo "Usage: /etc/init.d/lpd {start|stop|reload|force-reload|restart}"
        exit 1
	;;
esac

exit 0
