#!/bin/sh

action=$1

# Load the library and find various programs.
. /etc/init.d/LIB

killall=`pathof killall /bin:/usr/bin`

PROCS="lpd"


case $action in
	start)
		started=
		for p in $PROCS
		do
			if $killall -0 $p 2> /dev/null; then
				: already running
			else
				it=`pathof $p /usr/lib:/etc:/etc/daemons:/usr/etc`
				if [ -n "$it" ]; then
					if [ -z "$started" ]; then
						echo $use_escapes "Starting print services: \c"
						started=yes
					fi
					$it
					echo $use_escapes " $p\c"
				fi
			fi
		done
		if [ -n "$started" ]; then
			echo " ... done"
		fi
		;;

	stop)
		if wipeout $PROCS; then
			echo "Print services stopped"
		else
			echo "Print services weren't running"
		fi
		;;

	*)
		echo "usage: print start|stop"
		exit 1
		;;
esac
