#!/bin/sh # # $Id: lircd-init,v 1.2 2003/04/29 20:22:49 shamim Exp $ # # (Modified from the fr3 package for LIRC.) # # Startup script for the Linux Infrared Remote Control. # # chkconfig: - 90 10 # description: Enables infrared controls through LIRC. # # config: /etc/lircd.conf # Source 'em up . /etc/init.d/functions [ -x /usr/local/sbin/lircd ] || exit 1 [ -x /usr/local/sbin/lircmd ] || exit 1 [ -f /etc/lircd.conf ] || [ -f /etc/lircmd.conf ] || exit 1 PATH=$PATH:/usr/local/sbin:/usr/local/bin RETVAL=0 start(){ setserial /dev/lirc uart none if [ -f /etc/lircd.conf ]; then echo -n "Starting infrared remote control daemon: " daemon lircd RETVAL=$? fi if [ -f /etc/lircmd.conf ]; then echo -n "Starting infrared remote control mouse daemon: " daemon lircmd RETVAL=$? echo fi if [ -f /etc/lircrc ]; then echo -n "Starting infrared remote control exec daemon: " daemon irexec /etc/lircrc echo fi touch /var/lock/subsys/lircd return $RETVAL } stop(){ if [ -f /etc/lircmd.conf ]; then echo -n "Stopping infrared remote control mouse daemon: " killproc lircmd echo fi if [ -f /etc/lircrc ]; then echo -n "Stopping infrared remote control exec daemon: " killproc irexec echo fi if [ -f /etc/lircd.conf ]; then echo -n "Stopping infrared remote control daemon: " killproc lircd echo fi RETVAL=$? rm -f /var/lock/subsys/lircd setserial /dev/lirc uart 16550A return $RETVAL } restart(){ stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status lircd ;; condrestart) [ -e /var/lock/subsys/lircd ] && restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart}" RETVAL=1 esac exit $RETVAL