updated on Wed Jan 11 00:07:16 UTC 2012
[aur-mirror.git] / irda-utils / irda
blobc544643847fa8b1e8f6f55d6d367989c2e4d7738
1 #!/bin/bash
3 # source application-specific settings
4 [ -f /etc/conf.d/irda ] && . /etc/conf.d/irda
5 ARGS=
6 if [ $DONGLE ]; then
7 ARGS="$ARGS -d $DONGLE"
8 fi
9 if [ "$DISCOVERY" = "yes" -o "$DISCOVERY" = "YES" ]; then
10 ARGS="$ARGS -s"
12 ARGS="$DEVICE $ARGS"
14 . /etc/rc.conf
15 . /etc/rc.d/functions
17 PID=`pidof -o %PPID /usr/sbin/irattach`
18 case "$1" in
19 start)
20 stat_busy "Starting IrDA"
21 [ -z "$PID" ] && /usr/sbin/irattach ${ARGS}
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 add_daemon irda
26 stat_done
29 stop)
30 stat_busy "Shutting down IrDA"
31 [ ! -z "$PID" ] && kill $PID &> /dev/null
32 if [ $? -gt 0 ]; then
33 stat_fail
34 else
35 rm_daemon irda
36 stat_done
39 restart)
40 $0 stop
41 $0 start
44 echo "usage: `basename $0` {start|stop|restart}"
45 esac
46 exit 0