3 # lircd Linux Infrared Remote Control daemon
5 # chkconfig: 2345 65 35
6 # description: LIRC is a package that allows you to decode and send \
7 # infra-red signals of many (but not all) commonly used \
11 # pidfile: /var/run/lirc/lircd.pid
12 # config: /etc/lirc/lircd.conf
13 # config: /etc/sysconfig/lircd
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 [ -f /etc/sysconfig/lircd ] && . /etc/sysconfig/lircd
22 # Check if the service is already running?
23 if [ -f /var/lock/subsys/lircd ]; then
24 msg_already_running "Linux Infrared Remote Control daemon"
28 msg_starting "Linux Infrared Remote Control daemon"
30 [ -n "$DRIVER" ] && OPTIONS="--driver=$DRIVER"
31 [ -n "$DEVICE" ] && OPTIONS="$OPTIONS --device=$DEVICE"
32 #Check if use serial port
33 [ -n "$COM_PORT" ] && setserial $COM_PORT uart none
35 [ -n "$DRIVER_OPTS" ] && MODULE_OPTIONS="$DRIVER_OPTS"
36 modprobe -s lirc $MODULE_OPTIONS > /dev/null 2>&1
37 ln -sf /tmp/.lircd /dev/lircd
40 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lircd
45 if [ ! -f /var/lock/subsys/lircd ]; then
46 msg_not_running "Linux Infrared Remote Control daemon"
50 msg_stopping "Linux Infrared Remote Control daemon"
53 rm -f /var/lock/subsys/lircd >/dev/null 2>&1
57 test -f /var/lock/subsys/lircmd && RESTART_LIRCMD=yes
58 test -n "$RESTART_LIRCMD" && /sbin/service lircmd stop
61 test -n "$RESTART_LIRCMD" && /sbin/service lircmd start
65 if [ ! -f /var/lock/subsys/lircd ]; then
66 msg_not_running "Linux Infrared Remote Control daemon"
75 if [ ! -f /var/lock/subsys/lircd ]; then
76 msg_not_running "Linux Infrared Remote Control daemon"
81 msg_reloading "Linux Infrared Remote Control daemon"
87 # See how we were called.
109 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"