Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a WiFi module that is registered with a WiFi network. There are a few other WiFi networks in the area. The computer, however, does not know which WiFi network it can connect to.

So the computer has try to see which WiFi it can access the internet with. If it can't get on (and say access cnn.com) with one WiFi, it should try the next.

Is there a way to automatically do this with debian or a program like WiCD?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can do this in BASH. Simply check your connection every minute or ping response(if its too high). Scan networks, and switch it.

for scanning you can use:
$ iwlist wlan0 scan

for connecting you can use

#!/bin/bash
killall -9 dhclient
ifconfig wlan0 down
ifconfig wlan0 up
iwconfig wlan0 channel CHAN
iwconfig wlan0 essid ESSID
ifconfig wlan0 up
dhclient wlan0

you can easily bind(combine) the scanning script to(with) the connecting one using grep/awk/cut which are very helpful tools.

If you are using Ubuntu(Spying!!!) turn off network-manager service by:
temp solution till reboot
$ /etc/init.d/network-manager stop
permament solution till chmod +x (when you want networkmanager back)
$ chmod -x /etc/init.d/network-manager

on Fedora(You are safe for now!) the service is called NetworkManager:
temp sol:
$ service NetworkManager stop
perm sol:
$ service NetworkManager disable

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.