#!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later checkconfig() { if [ -z "$IRDA" ] || [ -z "$IRDADEV" ] ; then eerror "You need to setup IRDA and IRDADEV in /etc/conf.d/irda first" return 1 fi } start() { checkconfig || return 1 # Check that irda is enabled. [ ${IRDA} = "no" ] && return 1 [ -f /usr/sbin/irattach ] || return 1 local ARGS="" if [ $DONGLE ]; then ARGS="$ARGS -d $DONGLE" fi if [ "$DISCOVERY" = "yes" ];then ARGS="$ARGS -s" fi # Attach irda device ebegin "Starting IrDA" start-stop-daemon --start --quiet \ --exec /usr/sbin/irattach -- ${IRDADEV} ${ARGS} eend ${?} } stop() { ebegin "Shutting down IrDA" start-stop-daemon --stop --quiet --pidfile /var/run/irattach.pid eend ${?} }