summaryrefslogtreecommitdiffstats
path: root/network/irda-utils/rc.irda.new
blob: 88b62eff0a641b8abd3ff7080532be43436f073a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

# Start/stop/restart the irda daemon:
#
# This script is based on irda-utils' sysv-init script and 
# only covers SIR mode. For detailed instructionis on how
# to enable FIR mode see 'man 8 irattach' and README.irattach 
# in the doc directory. 

# You probably have to choose a different serial port (/dev/ttyS?). 
DEVICE=/dev/ttyS1
DISCOVERY=yes
#DONGLE=actisys+

[ -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 
        echo "Starting IrDA: /usr/sbin/irattach"
        /usr/sbin/irattach ${DEVICE} ${ARGS}
        ;;
  stop)
        # Stop service.
        echo "Stopping IrDA... "
	killall irattach
        ;;
  restart)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: irda {start|stop|restart}"
        exit 1
esac

exit 0