]> git.pld-linux.org Git - packages/lirc.git/blame - lircmd.init
- rebuild for kernel-3.6.10-1
[packages/lirc.git] / lircmd.init
CommitLineData
c62825f4 1#!/bin/sh
24daa3e2 2#
3# lircmd Linux Infrared Remote Control mouse daemon
4#
5# chkconfig: 2345 92 8
69aaf812 6# description: LIRC is a package that allows you to decode and send \
7# infra-red signals of many (but not all) commonly used \
24daa3e2 8# remote controls.
9#
10# processname: lircmd
5eb8c54f
KK
11# pidfile: /var/run/lirc/lircmd.pid
12# config: /etc/lirc/lircmd.conf
24daa3e2 13
14# Source function library
15. /etc/rc.d/init.d/functions
16
0587d182 17start() {
c62825f4 18 if [ ! -f /var/lock/subsys/lircmd ]; then
19 msg_starting "Linux Infrared Remote Control mouse daemon"
20 daemon lircmd
24daa3e2 21 RETVAL=$?
22 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lircmd
c62825f4 23 else
24 msg_already_running "Linux Infrared Remote Control mouse daemon"
c62825f4 25 fi
0587d182
JB
26}
27
28stop() {
c62825f4 29 if [ -f /var/lock/subsys/lircmd ]; then
24daa3e2 30 msg_stopping "Linux Infrared Remote Control mouse daemon"
31 killproc lircmd
24daa3e2 32 rm -f /var/lock/subsys/lircmd >/dev/null 2>&1
33 else
c62825f4 34 msg_not_running "Linux Infrared Remote Control mouse daemon"
c62825f4 35 fi
0587d182
JB
36}
37
38condrestart() {
39 if [ -f /var/lock/subsys/lircmd ]; then
40 stop
41 start
42 else
43 msg_not_running "Linux Infrared Remote Control mouse daemon"
44 RETVAL=$1
45 fi
46}
47
48RETVAL=0
49# See how we were called.
50case "$1" in
51 start)
52 start
c62825f4 53 ;;
0587d182
JB
54 stop)
55 stop
c62825f4 56 ;;
24daa3e2 57 restart)
0587d182
JB
58 stop
59 start
60 ;;
61 try-restart)
62 condrestart 0
c62825f4 63 ;;
4e29ad2e 64 reload|force-reload)
65 if [ -f /var/lock/subsys/lircmd ]; then
66 msg_reloading "Linux Infrared Remote Control mouse daemon"
67 killproc lircmd -HUP
68 RETVAL=$?
69 else
70 msg_not_running "Linux Infrared Remote Control mouse daemon" >&2
71 exit 7
72 fi
24daa3e2 73 ;;
0587d182
JB
74 status)
75 status lircmd
76 exit $?
77 ;;
24daa3e2 78 *)
0587d182 79 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
4e29ad2e 80 exit 3
24daa3e2 81 ;;
82esac
83
84exit $RETVAL
This page took 0.105023 seconds and 4 git commands to generate.