#!/bin/sh # # Startet den lirc demon case "$1" in start | resume) . /etc/init.d/rc.functions if [ -e /etc/lircd.conf ]; then if [ -z "${LIRC_MODUL#*COM1}" ]; then echo "Loading lirc serial driver" setserial /dev/ttyS0 uart none || failed modprobe lirc_serial check_status elif [ -z "${LIRC_MODUL#*COM2}" ]; then echo "Loading lirc serial driver" setserial /dev/ttyS1 uart none || failed modprobe lirc_serial irq=3 io=0x2f8 check_status elif [ -n "$LIRC_MODUL" ]; then args="-H $LIRC_MODUL" fi if [ -e /dev/lirc0 ]; then ln -fs lirc0 /dev/lirc fi echo "Starting lirc daemon" if ps | grep -v "grep" | grep -q "eventlircd"; then args="$args --uinput" #python /usr/bin/lircd2uinput & fi mkdir -p /var/run/lirc lircd $LIRC_ARGS $args /etc/lircd.conf || failed ln -fs /var/run/lirc/lircd /dev/lircd check_status fi ;; stop | halt) . /etc/init.d/rc.functions if [ -e /etc/lircd.conf ]; then echo "Stopping lirc daemon" killall lircd || failed rm -f /dev/lircd modprobe -r lirc_serial rm -f /dev/lirc #update_setting "VDR_RCU" "" #update_setting "VDR_SXFE_ARGS" "${VDR_SXFE_ARGS% --lirc}" check_status fi ;; restart) $0 stop $0 start ;; init) start=1 resume=1 halt=1 before=vdr after=eventlircd ;; *) echo "Usage $0 {start | stop | restart}" >&2 exit 1 esac