Line 0
Link Here
|
|
|
1 |
#!/sbin/runscript |
2 |
# Copyright 1999-2002 Gentoo Technologies, Inc. |
3 |
# Distributed under the terms of the GNU General Public License, v2 or later |
4 |
|
5 |
checkconfig() { |
6 |
if [ -z "$IRDA" ] || [ -z "$IRDADEV" ] ; then |
7 |
eerror "You need to setup IRDA and IRDADEV in /etc/conf.d/irda first" |
8 |
return 1 |
9 |
fi |
10 |
} |
11 |
|
12 |
start() { |
13 |
checkconfig || return 1 |
14 |
|
15 |
# Check that irda is enabled. |
16 |
[ ${IRDA} = "no" ] && return 1 |
17 |
|
18 |
[ -f /usr/sbin/irattach ] || return 1 |
19 |
|
20 |
local ARGS="" |
21 |
if [ $DONGLE ]; then |
22 |
ARGS="$ARGS -d $DONGLE" |
23 |
fi |
24 |
if [ "$DISCOVERY" = "yes" ];then |
25 |
ARGS="$ARGS -s" |
26 |
fi |
27 |
|
28 |
# Attach irda device |
29 |
ebegin "Starting IrDA" |
30 |
start-stop-daemon --start --quiet --pidfile /var/run/irda.pid \ |
31 |
--exec /usr/sbin/irattach -- ${IRDADEV} ${ARGS} |
32 |
eend ${?} |
33 |
} |
34 |
|
35 |
stop() { |
36 |
ebegin "Shutting down IrDA" |
37 |
start-stop-daemon --stop --quiet --pidfile /var/run/irda.pid |
38 |
eend ${?} |
39 |
} |