13 |
source /etc/conf.d/rc |
source /etc/conf.d/rc |
14 |
source ${rc_functions} |
source ${rc_functions} |
15 |
|
|
16 |
|
pidfile() |
17 |
|
{ |
18 |
|
local port |
19 |
|
local lockfile |
20 |
|
local config="/etc/lprng/lpd.conf" |
21 |
|
|
22 |
|
port=$(grep "^[[:space:]]*lpd_port" ${config} | cut -d "=" -f2) |
23 |
|
[[ -z ${port} ]] && port="515" |
24 |
|
|
25 |
|
lockfile=$(grep "^[[:space:]]*lockfile" ${config} | cut -d "=" -f2) |
26 |
|
[[ -z ${lockfile} ]] && lockfile="/var/run/lpd" |
27 |
|
|
28 |
|
echo "${lockfile}.${port}" |
29 |
|
} |
30 |
|
|
31 |
case $1 in |
case $1 in |
32 |
start) |
start) |
33 |
echo -e ${COLOREDSTAR}"Starting LPRng Printserver ..." |
rc_print "Starting LPRng Printserver ..." |
34 |
start-stop-daemon --start --quiet --exec /usr/sbin/lpd |
start-stop-daemon --start --quiet --exec /usr/sbin/lpd |
35 |
|
|
36 |
update_svcstatus $1 |
update_svcstatus $1 |
38 |
;; |
;; |
39 |
|
|
40 |
stop) |
stop) |
41 |
echo -e ${COLOREDSTAR}"Stopping LPRng Printserver ..." |
rc_print "Stopping LPRng Printserver ..." |
42 |
start-stop-daemon --stop --quiet --exec /usr/sbin/lpd |
start-stop-daemon --stop --quiet --pidfile $(pidfile) |
43 |
|
|
44 |
update_svcstatus $1 |
update_svcstatus $1 |
45 |
splash svc_stopped "$(basename $0)" 0 |
splash svc_stopped "$(basename $0)" 0 |
56 |
;; |
;; |
57 |
|
|
58 |
*) |
*) |
59 |
echo "Usage: $0 {start|stop|restart|status}" |
rc_echo "Usage: $0 {start|stop|restart|status}" |
60 |
exit 1 |
exit 1 |
61 |
;; |
;; |
62 |
esac |
esac |