#!/bin/sh # Starts irexec # . /etc/init.d/rc.functions START_IREXEC="true" if [ -f /etc/lirc/hardware.conf ];then . /etc/lirc/hardware.conf fi case "$1" in start) if [ ! -f /etc/lirc/lircrc ] || grep -q "^#UNCONFIGURED" /etc/lirc/lircrc; then START_IREXEC=false fi if [ "$START_IREXEC" = "true" ]; then echo "Starting execution daemon: irexec" start-stop-daemon --start --quiet --oknodo --exec /usr/bin/irexec -- -d /etc/lirc/lircrc < /dev/null fi check_status ;; stop) if [ "$START_IREXEC" = "true" ]; then echo "Stopping execution daemon: irexec" start-stop-daemon --stop --quiet --exec /usr/bin/irexec fi check_status ;; reload|force-reload) if [ "$START_IREXEC" = "true" ]; then start-stop-daemon --stop --quiet --signal 1 --exec /usr/bin/irexec fi check_status ;; restart) $0 stop #passes parameter $2 which is possibly our udev paramater $0 start $2 ;; init) resume=1 halt=1 after=eventlircd ;; *) echo "Usage $0 {start|stop|reload|restart|force-reload}" >&2 exit 1 esac