Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################################################################################
- # #
- # The following configuration file is generated automatically by the yaVDR #
- # system. Don't change this file as every update of yaVDR will overwrite #
- # the local changes. Instead put your required customizations #
- # into /etc/yavdr/templates_custom/ based on the original templates #
- # under /usr/share/yavdr/templates. #
- # #
- # http://www.yavdr.org/developer-zone/template-overview/ #
- # #
- # #
- #################################################################################
- # Starts LIRC daemon.
- #
- # LIRC is used to control different
- # infrared receivers and transceivers.
- description "LIRC Daemon"
- author "Gerald Dachs <gda@dachsweb.de>"
- start on starting vdr
- stop on runlevel [016]
- respawn
- normal exit 0
- script
- load_modules ()
- {
- MODULES_MISSING=false
- for mod in $*; do
- modprobe $mod 2> /dev/null || MODULES_MISSING=true
- done
- if $MODULES_MISSING; then
- exit 0
- fi
- }
- test -f /usr/sbin/lircd || exit 0
- if [ -f /etc/lirc/hardware.conf ];then
- . /etc/lirc/hardware.conf
- fi
- if [ ! -f /etc/lirc/lircd.conf ] || \
- grep -q "^#UNCONFIGURED" /etc/lirc/lircd.conf ||\
- [ "x$START_LIRCD" = "xfalse" ]; then
- exit 0
- fi
- #We need default socket locations
- OLD_SOCKET="/dev/lircd"
- if [ -z "$REMOTE_SOCKET" ]; then
- REMOTE_SOCKET="/var/run/lirc/lircd"
- fi
- [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
- if [ "$LOAD_MODULES" = "true" ]; then
- load_modules $REMOTE_MODULES
- fi
- build_remote_args ()
- {
- REMOTE_ARGS="$*"
- #For remote only detection support, we need
- #both REMOTE_DEVICE and TRANSMITTER_DEVICE undefined
- if [ -z "$REMOTE_DEVICE" ] && [ -z "$TRANSMITTER_DEVICE" ] && [ -c $dev ]; then
- REMOTE_DEVICE="$dev"
- fi
- #If we have a REMOTE_DEVICE or REMOTE_DRIVER defined (either because no devices
- #were defined, OR if we explicitly did), then populate REMOTE_ARGS
- if [ ! -z "$REMOTE_DEVICE" ] || [ ! -z "$REMOTE_DRIVER" ]; then
- if [ -n "$REMOTE_DEVICE" ] && [ "$REMOTE_DEVICE" != "none" ]; then
- REMOTE_ARGS="--device=$REMOTE_DEVICE $REMOTE_ARGS"
- fi
- if [ -n "$REMOTE_DRIVER" ] && [ "$REMOTE_DRIVER" != "none" ]; then
- REMOTE_ARGS="--driver=$REMOTE_DRIVER $REMOTE_ARGS"
- fi
- #Now, if we ALSO have a transmitter defined, add some args
- #To make the first lircd listen up
- if [ ! -z "$TRANSMITTER_DEVICE" ] || [ ! -z "$TRANSMITTER_DRIVER" ]; then
- REMOTE_ARGS="$REMOTE_ARGS --listen"
- fi
- REMOTE_ARGS="--output=$REMOTE_SOCKET $REMOTE_ARGS"
- fi
- echo $REMOTE_ARGS
- }
- REMOTE_LIRCD_ARGS=`build_remote_args $REMOTE_LIRCD_ARGS`
- if [ -z "$REMOTE_LIRCD_ARGS" ]; then
- exit 0
- fi
- if [ "$OLD_SOCKET" != "$REMOTE_SOCKET" ]; then
- rm -f $OLD_SOCKET && ln -s $REMOTE_SOCKET $OLD_SOCKET
- fi
- exec /usr/sbin/lircd --nodaemon $REMOTE_LIRCD_ARGS
- end script
- post-start script
- if [ -f /etc/lirc/hardware.conf ];then
- . /etc/lirc/hardware.conf
- fi
- if [ ! -f /etc/lirc/lircd.conf ] || \
- grep -q "^#UNCONFIGURED" /etc/lirc/lircd.conf ||\
- [ "x$START_LIRCD" = "xfalse" ]; then
- exit 0
- else
- while [ ! -e /dev/lircd ]; do
- sleep 0.1
- done
- fi
- end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement