diff options
Diffstat (limited to 'packages/irda-utils/files/init')
-rwxr-xr-x | packages/irda-utils/files/init | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/packages/irda-utils/files/init b/packages/irda-utils/files/init index f1594aae87..e7163d3ad3 100755 --- a/packages/irda-utils/files/init +++ b/packages/irda-utils/files/init @@ -1,6 +1,34 @@ #! /bin/sh -# Source IrDA networking configuration. +module_id() { + awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo +} + +if [ ! -f /etc/sysconfig/irda ]; then + + case `module_id` in + "HP iPAQ H2200" | "HP iPAQ HX4700") + IRDA=yes + DEVICE=/dev/tts/2 + DONGLE= + DISCOVERY= + ;; + *) + IRDA=yes + DEVICE=/dev/ttyS1 + DONGLE= + DISCOVERY= + ;; + esac + + echo "IRDA=$IRDA" > /etc/sysconfig/irda + if [ $IRDA = "yes" ]; then + echo "DEVICE=$DEVICE" >> /etc/sysconfig/irda + echo "DONGLE=$DONGLE" >> /etc/sysconfig/irda + echo "DISCOVERY=$DISCOVERY" >> /etc/sysconfig/irda + fi +fi + . /etc/sysconfig/irda # Check that irda is up. |