Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2002 17:00:47 +0200
From:      Olof Samuelsson <olof@crt.se>
To:        tony@saign.com
Cc:        freebsd-mobile@FreeBSD.ORG
Subject:   Re: start_if.wi0??
Message-ID:  <lf1yb67xwg.wl@boulard.crt.se>
In-Reply-To: <000001c215bb$0bf098e0$1401a8c0@frankenmobl>
References:  <000001c215bb$0bf098e0$1401a8c0@frankenmobl>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
>>>>> "Tony" == Tony Saign <tony@saign.com> writes:

> Anyone have an example of a script to connect to 2 different nets?
> I've been playing around with it without success!

> Running 4.6 -stable and MiniPCI Intersil 802.11b card.

I use a Lucent card, but I do soemthing like this (improvements
welcome):

#!/bin/sh
ifconfig wi0 inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up
sleep 2
CNETNAME=`wicontrol |sed -ne '/Current netname/s/.*\[ \(.*\) \]/\1/p'`
logger -p user.notice "After sleeping and starting if, netname == \"$CNETNAME\""
case "$CNETNAME" in
        mynet|other_net_too_near)
                logger -p user.notice "Setting netname to mynet for wi0"
                wicontrol -n mynet
                logger -p user.notice "Setting wep key for mynet"
                ifconfig wi0 nwkey 0x1234567890
        ;;
        myothernet)
                logger -p user.notice "Setting netname to myothernet for wi0"
                wicontrol -n myothernet
                logger -p user.notice "Setting wep key for myothernet"
                ifconfig wi0 nwkey 0x1234567890
        ;;
        *)
                logger -p user.notice "I'm away, not changing netname"
                logger -p user.notice "I'm away, not enabling WEP"
        ;;
esac

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?lf1yb67xwg.wl>