summaryrefslogtreecommitdiff
path: root/packages/irda-utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/irda-utils')
-rwxr-xr-xpackages/irda-utils/files/init21
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/irda-utils/files/init b/packages/irda-utils/files/init
index 2d93af34df..1944b9d782 100755
--- a/packages/irda-utils/files/init
+++ b/packages/irda-utils/files/init
@@ -1,21 +1,26 @@
#! /bin/sh
+NAME="irattach"
+
module_id() {
awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
}
+cpuid_id() {
+ awk '/Processor/ { print $3; exit; }' /proc/cpuinfo
+}
if [ ! -f /etc/sysconfig/irda ]; then
- case `module_id` in
- "HP iPAQ H2200" | "HP iPAQ HX4700" | "HTC Universal")
+ case `cpuid_id` in
+ "XScale-PXA2"*)
IRDA=yes
DEVICE=/dev/ttyS2
DONGLE=
DISCOVERY=
;;
*)
- IRDA=yes
- DEVICE=/dev/ttyS1
+ IRDA=no
+ DEVICE=/dev/null
DONGLE=
DISCOVERY=
;;
@@ -48,19 +53,19 @@ fi
case "$1" in
start)
echo -n "Starting IrDA: "
- irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
+ irattach ${DEVICE} ${ARGS} > /dev/null 2>&1
echo "$NAME."
;;
stop)
echo -n "Stopping IrDA: "
- killall irattach > /dev/null 2>&1
+ killall irattach > /dev/null 2>&1
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting IrDA: "
- irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
+ irattach ${DEVICE} ${ARGS} > /dev/null 2>&1
sleep 1
- killall irattach > /dev/null 2>&1
+ killall irattach > /dev/null 2>&1
echo "$NAME."
;;
*)