Little fix.
[irreco.git] / lirc-0.8.4a / contrib / lirc.suse6.2
blob3506c0900575d657ba5f0101aa24cb24bf2b1633
1 #! /bin/sh
3 # This is an init script created for a S.u.S.E. 6.2 distribution.
5 # Author: CW Zuckschwerdt <zany@triq.net>
7 # /sbin/init.d/lircd
9 # and symbolic its link
11 # /sbin/rc?.d/K20lircd
12 # /sbin/rc?.d/S20lircd
15 . /etc/rc.config
17 # Determine the base and follow a runlevel link name.
18 base=${0##*/}
19 link=${base#*[SK][0-9][0-9]}
21 # Force execution if not called by a runlevel directory.
22 test $link = $base && START_LIRCD=yes
23 # test "$START_LIRCD" = yes || exit 0
25 # The echo return value for success (defined in /etc/rc.config).
26 return=$rc_done
27 case "$1" in
28 start)
29 echo -n "Starting daemon lircd"
30 ## Start daemon with startproc(8). If this fails
31 ## the echo return value is set appropriate.
33 startproc /usr/local/sbin/lircd || return=$rc_failed
35 echo -e "$return"
37 stop)
38 echo -n "Shutting down daemon lircd"
39 ## Stop daemon with killproc(8) and if this fails
40 ## set echo the echo return value.
42 killproc -TERM /usr/local/sbin/lircd || return=$rc_failed
44 echo -e "$return"
46 restart)
47 ## If first returns OK call the second, if first or
48 ## second command fails, set echo return value.
50 $0 stop && $0 start || return=$rc_failed
52 reload)
53 ## both lircd and lircmd will re-read their
54 ## config files on receipt of SIGHUP
56 echo -n "Reload daemon lircd"
58 killproc -HUP /usr/local/sbin/lircd || return=$rc_failed
60 echo -e "$return"
62 status)
63 echo -n "Checking for daemon lircd: "
64 ## Check status with checkproc(8), if process is running
65 ## checkproc will return with exit status 0.
67 checkproc /usr/local/sbin/lircd && echo OK || echo No process
70 echo "Usage: $0 {start|stop|status|restart|reload}"
71 exit 1
73 esac
75 # Inform the caller not only verbosely and set an exit status.
76 test "$return" = "$rc_done" || exit 1
77 exit 0