summaryrefslogtreecommitdiff
path: root/packages/irda-utils/files
diff options
context:
space:
mode:
authorMatt Reimer <mattjreimer@gmail.com>2006-01-30 22:06:02 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-01-30 22:06:02 +0000
commite7bd9c51874c4fb5194f02ae104e76cb08fcc7b1 (patch)
tree86d92783e3717df575609615bdefd615095ec353 /packages/irda-utils/files
parent603329d8d9b8c9128c6d691dcb817182edcaaa0d (diff)
irda-utils: instead of assuming that /dev/ttyS1 is the IrDA port, get the
port and attendant arguments from /etc/sysconfig/irda.
Diffstat (limited to 'packages/irda-utils/files')
-rwxr-xr-xpackages/irda-utils/files/init26
1 files changed, 20 insertions, 6 deletions
diff --git a/packages/irda-utils/files/init b/packages/irda-utils/files/init
index f644e59295..f1594aae87 100755
--- a/packages/irda-utils/files/init
+++ b/packages/irda-utils/files/init
@@ -1,21 +1,35 @@
#! /bin/sh
-DESC=irattach
+# 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
case "$1" in
start)
- echo -n "Starting $DESC: "
- irattach /dev/ttyS1 > /dev/null 2>&1 &
+ echo -n "Starting IrDA: "
+ irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
echo "$NAME."
;;
stop)
- echo -n "Stopping $DESC: "
+ echo -n "Stopping IrDA: "
killall irattach > /dev/null 2>&1
echo "$NAME."
;;
restart|force-reload)
- echo -n "Restarting $DESC: "
- irattach /dev/ttyS1 > /dev/null 2>&1 &
+ echo -n "Restarting IrDA: "
+ irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
sleep 1
killall irattach > /dev/null 2>&1
echo "$NAME."