|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
autoconnect to wifi (script)
In order to automatize connection to the several wifi network in which my opebsd netbook travel, I tried to write a small script. Here it is :
Code:
#!/bin/sh CONF=/etc/wifi-conf . $CONF # void any previous conf ifconfig $IF -nwid -wpakey # scan wifi network, list them by network name, and get rid any "nwid" still there SCAN=`ifconfig $IF scan|grep nwid|cut -d" " -f 2|sed '/nwid/d'` # read the list of known nets while read line do # the first args of each line is the net name NET=`echo $line|cut -d" " -f 1` # the second is the key KEY=`echo $line|cut -d" " -f 2` # we compare the name to the list of scanned nets for ID in $SCAN do if [ $NET = $ID ]; then ifconfig $IF nwid $ID wpakey $KEY ifconfig $IF up if [ $AICCU ] then aiccu start fi fi done done < $LIST If someone has knowledge of a script working for that purpose, I would use it of course ! Here is the conf : Code:
IF=ral0 AICCU=true RTSOL=true DHCP=true LIST=/etc/wifi-net Code:
decembre kalCkucakospevPOFardOs9Droy NET4LD 2468000 Stjernen2 Vejlby2 |
|
|||
What's not working? What does it do, what does it not do?
You don't seem to be running dhclient but I don't even know if you make it that far... Tim. |
|
|||
It connects often to a network I can't use.
Quote:
Apparently not ! So at the end, yes I should dhcp, rtsol and aiccu if I don't have native ipv6 (which I have at home, but not in the two other networks. But first, I would like that it connect/get an active link to a network I am allowed / have the credentials. |
|
|||
I don't have wifi on this system so I can't try the script as a whole.
I'd echo the value of ID and NET just before you compare them and make sure you are seeing expected values. Then if it's an ifconfig issue, we can focus on that. Ifconfig doesn't use hostname.if, /etc/netstart does. My solution to this problem, instead of maintaining a bunch of extra files, would be to configure each access point in hostname.if.nwid and then use the script to copy the right file as hostname.if and and run netstart. Tim. |
|
|||
Quite a smart idea ! Yet, I don't know... Will try.
|
|
|||
Currently, it works.
Will test in real conditions tomorrow (as I am going in the two other networks). |
|
|||
The ksh(1) -x option is your friend.
|
|
|||
Just a few remarks as of last experiments for today :
I don't know why but "rtsol" alone doesn't work in this precise environnement, thus, I don't have ipv6 whereas I have native here (at home). To have it, I had to run it like a command at the end of my hostname file for the local network. Code:
... blabla... up dhcp rtsol !rtsol ral0 |
|
|||
Quote:
http://marc.info/?l=openbsd-cvs&m=141923963522262&w=2 You likely want this: http://marc.info/?l=openbsd-cvs&m=140897526404246&w=2 |
|
|||
I Tried autoconf, and it failed indeed. But not inet6 autoconf.
Thanks ! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
wifi performance (rum) | mickywicky | OpenBSD General | 11 | 25th October 2013 03:08 PM |
wifi secured with 802.1x EAP | petter | OpenBSD General | 1 | 13th March 2013 09:16 AM |
DesktopBSD & usb wifi | radtek | FreeBSD General | 1 | 10th September 2008 09:13 PM |
Two FW + WiFi AP Inquiry | revzalot | OpenBSD Security | 4 | 14th July 2008 11:24 PM |
Any wifi enthusiasts here? | PatrickBaer | General software and network | 14 | 1st July 2008 01:45 PM |