#!/bin/sh # # Startup script for the Linux Infrared Remote Control daemons # LIRCD_CMD="/usr/sbin/lircd" LIRCMD_CMD="/usr/sbin/lircmd" start() { echo "Starting infrared remote control daemon (LIRCD)" $LIRCD_CMD if [ -f /var/run/lirc/lircd.pid ] ; then echo "Starting infrared remote control mouse daemon (LIRCMD)" $LIRCMD_CMD if [ -f /var/run/lirc/lircmd.pid ] ; then rm /var/run/lirc/lircmd.pid ; fi pidof lircmd > /var/run/lirc/lircmd.pid fi } stop() { if [ -f /var/run/lirc/lircd.pid ] ; then echo "Stopping infrared remote control daemon (LIRCD)" kill -9 $(cat /var/run/lirc/lircd.pid) fi if [ -f /var/run/lirc/lircmd.pid ] ; then echo "Stopping infrared remote control mouse daemon (LIRCMD)" kill -9 $(cat /var/run/lirc/lircmd.pid) fi } restart() { stop start } force_restart() { stop killall lircd 2>&1>/dev/null killall lircmd 2>&1>/dev/null rm /var/run/lirc/lircd.pid rm /var/run/lirc/lircmd.pid start } status() { if [ -f /var/run/lirc/lircd.pid ] ; then echo "Infrared remote control daemon (LIRCD) running..." fi if [ -f /var/run/lirc/lircmd.pid ] ; then echo "Infrared remote control mouse daemon (LIRCMD) running..." fi } case "$1" in start|stop|restart|status|force-restart) $1 ;; *) echo "Usage: $(basename $0) {start|stop|status|restart|force-restart}" esac