Re: start_if.wi0??
Olof Samuelsson <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.mobile |
|---|---|
| Message-ID | <[email protected]> |
>>>>> "Tony" == Tony Saign <[email protected]> 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 [email protected] with "unsubscribe freebsd-mobile" in the body of the message