3 # This is an init script created for a S.u.S.E. 6.2 distribution.
5 # Author: CW Zuckschwerdt <zany@triq.net>
9 # and symbolic its link
11 # /sbin/rc?.d/K20lircd
12 # /sbin/rc?.d/S20lircd
17 # Determine the base and follow a runlevel link name.
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).
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
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
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
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
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}"
75 # Inform the caller not only verbosely and set an exit status.
76 test "$return" = "$rc_done" ||
exit 1