Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 638a49e108ed1bc22470b49963caae26 > files > 1

irda-utils-0.9.14-5mdk.i586.rpm

#!/bin/sh
#
# irda          This shell script takes care of starting and stopping
#               IrDA support
#
# chkconfig: 2345 45 96
#
# description: IrDA stack for Linux
#

# Source function library.
. /etc/rc.d/init.d/functions

# Source IrDA networking configuration.
. /etc/sysconfig/irda

# Check that irda is up.
[ ${IRDA} = "no" ] && exit 0

[ -f /usr/sbin/irattach ] || exit 0

ARGS=
if [ $DONGLE ]; then
	ARGS="$ARGS -d $DONGLE"
fi
if [ "$DISCOVERY" = "yes" ];then
	ARGS="$ARGS -s"
fi

# See how we were called.
case "$1" in
  start)
        # Attach irda device 
        gprintf "Starting IrDA: "
        daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
	touch /var/lock/subsys/irda
        echo
        ;;
  stop)
        # Stop service.
        gprintf "Shutting down IrDA: "
	killproc irattach
	rm -f /var/lock/subsys/irda
        echo
        ;;
  status)
	status irattach
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
        gprintf "Usage: irda {start|stop|restart|reload|status}\n"
        exit 1
esac

exit 0