From owner-freebsd-mobile Mon Jun 17 8: 2: 0 2002 Delivered-To: freebsd-mobile@freebsd.org Received: from nic.crt.se (nic.crt.se [193.12.107.10]) by hub.freebsd.org (Postfix) with ESMTP id 54E5637B43D for ; Mon, 17 Jun 2002 08:00:51 -0700 (PDT) Received: from mail.crt.se (postiljon.crt.se [172.16.1.14]) by nic.crt.se (Postfix) with ESMTP id CD6DF528F; Mon, 17 Jun 2002 17:00:49 +0200 (MEST) Received: from localhost.hemma.crt.se (boulard.crt.se [172.16.1.201]) by mail.crt.se (Postfix) with ESMTP id 0A67B1DF6; Mon, 17 Jun 2002 17:00:49 +0200 (MEST) Date: Mon, 17 Jun 2002 17:00:47 +0200 Message-ID: From: Olof Samuelsson To: tony@saign.com Cc: freebsd-mobile@FreeBSD.ORG Subject: Re: start_if.wi0?? In-Reply-To: <000001c215bb$0bf098e0$1401a8c0@frankenmobl> References: <000001c215bb$0bf098e0$1401a8c0@frankenmobl> User-Agent: Wanderlust/2.9.7 (Unchained Melody) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386-unknown-freebsd4.4) X-Attribution: Olof MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >>>>> "Tony" == Tony Saign 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