Magellan Linux

Diff of /trunk/lprng/lprng.rc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1299 by niro, Tue Jun 10 22:19:59 2008 UTC revision 1300 by niro, Wed Mar 9 21:40:14 2011 UTC
# Line 13  Line 13 
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
# Line 23  case $1 in Line 38  case $1 in
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
# Line 41  case $1 in Line 56  case $1 in
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

Legend:
Removed from v.1299  
changed lines
  Added in v.1300