LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (http://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Connect automatically to any known Wi-Fi network (http://www.linuxquestions.org/questions/linux-wireless-networking-41/connect-automatically-to-any-known-wi-fi-network-944283/)

Spym 05-10-2012 03:25 PM

Connect automatically to any known Wi-Fi network
 
Hello guys.

I have the Ubuntu Server on embedded PC, which can move between some Wi-Fi networks.
This PC needs to be automatically connected to any known Wi-Fi network as soon as it becomes available (i.e. visible).

Yes, I can write a script for this, but I don't want to reinvent the wheel. Are there any solutions?

Thanks in advance.

blue_print 05-11-2012 08:03 AM

This Youtube link will help you!

http://www.youtube.com/watch?v=H1bhzzw4IUQ

Spym 05-11-2012 08:13 AM

Thank you, but I can't use GUI on embedded system. :)
I need for some non-GUI solution, something like this:
Code:

while true
do
  iwlist eth1 scan > /tmp/wiscan.txt
  if `cat /tmp/wiscan.txt | grep -c SSID1` = 1 then
  do
    iwconfig eth0 ssid SSID1
    exit
  done

  if `cat /tmp/wiscan.txt | grep -c SSID2` = 1 then
  do
    iwconfig eth0 ssid SSID2
    exit
  done

  sleep 3
done

(source: http://habrahabr.ru/qa/19230/#answer_78535)


All times are GMT -5. The time now is 12:17 PM.