Answer the question
In order to leave comments, you need to log in
How to organize automatic connection to any known wireless network?
There is an embedded computer running Ubuntu Server 11.10, and several geographically dispersed wireless networks between which the computer can physically move.
It is necessary to automatically connect to any known Wi-Fi network as soon as it becomes visible (this behavior is implemented by graphical network managers, such as Network Manager).
For one network, the task is trivially solved (/etc/network/interfaces), but are there ready-made solutions for my case? I don't want to reinvent the wheel.
Answer the question
In order to leave comments, you need to log in
Write a script to find and connect to networks in /etc/network/if-post-down.d
Something like this:
#!/bin/sh
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question