File: init.freebsd.sh

package info (click to toggle)
lprng 3.8.28-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 34,144 kB
  • ctags: 4,574
  • sloc: ansic: 36,641; sh: 12,740; perl: 2,916; makefile: 1,261; sed: 27
file content (45 lines) | stat: -rw-r--r-- 948 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# -- START --
# init.freebsd.sh,v 1.1 2001/08/21 20:33:15 root Exp
# This file can be installed in /usr/local/etc/init.d
#  as lprng.sh
# Freebsd 3.x and 4.x will run all files in this directory
#  with the suffix .sh as shell scripts
#
# If you do NOT replace the FreeBSD lpd with LRPng's
# in /usr/sbin/lpd,  then you should edit the /etc/rc.conf
# and set
#   lpd_enable=NO
#


lprng_enable="YES"
if [ -f /usr/local/etc/rc.subr ] ; then
	. /usr/local/etc/rc.subr
	load_rc_config lprng
	name=lprng
	rcvar=`set_rcvar`
	lprng_enable=`eval echo \\$\$rcvar`;
elif [ -f /etc/rc.conf ] ; then
	. /etc/rc.conf
fi

# ignore INT signal
trap '' 2

case "$1" in
    restart ) 
			$0 stop
			sleep 1
			$0 start
            ;;
    stop  )
		kill -INT `ps ${PSHOWALL} | awk '/lpd/{ print $1;}'` >/dev/null 2>&1
            ;;
    start )
		if [ "$lprng_enable" != NO ] ; then
            echo -n ' printer';
            ${LPD_PATH}
		fi
            ;;
esac