summaryrefslogtreecommitdiff
blob: 00bceec244aeb39bd560b84dd24cd52248082f28 (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
#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/sys-apps/irda-utils/files/irda.rc,v 1.1 2002/12/15 18:45:30 chadh Exp $

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 ${?}
}