summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/irda-utils/files/init
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-05-09 18:38:19 +0000
committerRichard Purdie <richard@openedhand.com>2006-05-09 18:38:19 +0000
commitb4cb437c6595ff8ac13506e502fe04b1a60c4e04 (patch)
treef529de217094f1a49049f90c49d779a49e19cd7c /openembedded/packages/irda-utils/files/init
parent3baacb49c13a48798d45e30a0a0076ca0b8c9e6a (diff)
downloadpoky-b4cb437c6595ff8ac13506e502fe04b1a60c4e04.tar.gz
Merge packages changes from OE into poky.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@386 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/irda-utils/files/init')
-rwxr-xr-xopenembedded/packages/irda-utils/files/init55
1 files changed, 49 insertions, 6 deletions
diff --git a/openembedded/packages/irda-utils/files/init b/openembedded/packages/irda-utils/files/init
index f644e59295..9becfcc0ed 100755
--- a/openembedded/packages/irda-utils/files/init
+++ b/openembedded/packages/irda-utils/files/init
@@ -1,21 +1,64 @@
1#! /bin/sh 1#! /bin/sh
2 2
3DESC=irattach 3module_id() {
4 awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
5}
6
7if [ ! -f /etc/sysconfig/irda ]; then
8
9 case `module_id` in
10 "HP iPAQ H2200" | "HP iPAQ HX4700")
11 IRDA=yes
12 DEVICE=/dev/ttyS2
13 DONGLE=
14 DISCOVERY=
15 ;;
16 *)
17 IRDA=yes
18 DEVICE=/dev/ttyS1
19 DONGLE=
20 DISCOVERY=
21 ;;
22 esac
23
24 mkdir -p /etc/sysconfig
25 echo "IRDA=$IRDA" > /etc/sysconfig/irda
26 if [ $IRDA = "yes" ]; then
27 echo "DEVICE=$DEVICE" >> /etc/sysconfig/irda
28 echo "DONGLE=$DONGLE" >> /etc/sysconfig/irda
29 echo "DISCOVERY=$DISCOVERY" >> /etc/sysconfig/irda
30 fi
31fi
32
33. /etc/sysconfig/irda
34
35# Check that irda is up.
36[ ${IRDA} = "no" ] && exit 0
37
38[ -f /usr/sbin/irattach ] || exit 0
39
40ARGS=
41if [ $DONGLE ]; then
42 ARGS="$ARGS -d $DONGLE"
43fi
44if [ "$DISCOVERY" = "yes" ];then
45 ARGS="$ARGS -s"
46fi
4 47
5case "$1" in 48case "$1" in
6 start) 49 start)
7 echo -n "Starting $DESC: " 50 echo -n "Starting IrDA: "
8 irattach /dev/ttyS1 > /dev/null 2>&1 & 51 irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
9 echo "$NAME." 52 echo "$NAME."
10 ;; 53 ;;
11 stop) 54 stop)
12 echo -n "Stopping $DESC: " 55 echo -n "Stopping IrDA: "
13 killall irattach > /dev/null 2>&1 56 killall irattach > /dev/null 2>&1
14 echo "$NAME." 57 echo "$NAME."
15 ;; 58 ;;
16 restart|force-reload) 59 restart|force-reload)
17 echo -n "Restarting $DESC: " 60 echo -n "Restarting IrDA: "
18 irattach /dev/ttyS1 > /dev/null 2>&1 & 61 irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
19 sleep 1 62 sleep 1
20 killall irattach > /dev/null 2>&1 63 killall irattach > /dev/null 2>&1
21 echo "$NAME." 64 echo "$NAME."