]> git.pld-linux.org Git - packages/lirc.git/blame - lircmd.init
unify initscripts
[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() {
af64b40b 18 if [ -f /var/lock/subsys/lircmd ]; then
c62825f4 19 msg_already_running "Linux Infrared Remote Control mouse daemon"
af64b40b 20 return
c62825f4 21 fi
af64b40b
ER
22
23 msg_starting "Linux Infrared Remote Control mouse daemon"
24 daemon lircmd
25 RETVAL=$?
26 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lircmd
0587d182
JB
27}
28
29stop() {
af64b40b 30 if [ ! -f /var/lock/subsys/lircmd ]; then
c62825f4 31 msg_not_running "Linux Infrared Remote Control mouse daemon"
af64b40b 32 return
c62825f4 33 fi
af64b40b
ER
34
35 msg_stopping "Linux Infrared Remote Control mouse daemon"
36 killproc lircmd
37 rm -f /var/lock/subsys/lircmd >/dev/null 2>&1
0587d182
JB
38}
39
40condrestart() {
af64b40b 41 if [ ! -f /var/lock/subsys/lircmd ]; then
0587d182
JB
42 msg_not_running "Linux Infrared Remote Control mouse daemon"
43 RETVAL=$1
af64b40b 44 return
0587d182 45 fi
af64b40b
ER
46
47 stop
48 start
49}
50
51reload() {
52 if [ ! -f /var/lock/subsys/lircmd ]; then
53 msg_not_running "Linux Infrared Remote Control mouse daemon"
54 RETVAL=7
55 return
56 fi
57
58 msg_reloading "Linux Infrared Remote Control mouse daemon"
59 killproc lircmd -HUP
60 RETVAL=$?
0587d182
JB
61}
62
63RETVAL=0
64# See how we were called.
65case "$1" in
66 start)
67 start
c62825f4 68 ;;
0587d182
JB
69 stop)
70 stop
c62825f4 71 ;;
24daa3e2 72 restart)
0587d182
JB
73 stop
74 start
75 ;;
76 try-restart)
77 condrestart 0
c62825f4 78 ;;
4e29ad2e 79 reload|force-reload)
af64b40b 80 reload
24daa3e2 81 ;;
0587d182
JB
82 status)
83 status lircmd
84 exit $?
85 ;;
24daa3e2 86 *)
0587d182 87 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
4e29ad2e 88 exit 3
24daa3e2 89 ;;
90esac
91
92exit $RETVAL
This page took 0.098468 seconds and 4 git commands to generate.