Modified wirelessfix.sh

I don’t know who originated the bash script called wirelessfix.sh, but it’s great solution to common ndiswrapper problems. Thank you.

I expanded on it. With my version if I pass a parameter to the script, it will set the essid to the parameter that I passed. If I run the script without the parameter, it will bring up a less screen with the results of “iwlist eth1 scan”, and upon exit from less will request an essid. Often, I copy the essid from the less page and past it when I exit less. Either way , it will bring up the interface with the essid.

Here’s my wirelessfix.sh:
Note1: In myscript, I commented out “modprobe b44” because it wasn’t doing anything for me. You might need it.
Note2: My interface is eth1. Yours might be different.

#!/bin/bash
ifdown eth1
modprobe -r b44
modprobe -r b43
modprobe -r b43legacy
modprobe -r ssb
modprobe -r ndiswrapper
modprobe ndiswrapper
# removed: modprobe b44
if [ -n “$1” ]; then
sudo iwconfig eth1 essid $1
else
iwlist eth1 scan | less
read -p essid: essid
sudo iwconfig eth1 essid $essid
fi
ifup eth1

Adding WEP key with iwconfig

Using Linux, with ndiswrapper for the wireless card, and using the command line to connect, I was having trouble connecting to a wireless access point with a WEP key until I put the keyword “open” in front of the string. If you’re pretty sure you’re entering the correct key and ESSID for a WEP encrypted access point, but still having trouble connecting, look at the man pages for iwconfig and see the examples under the section labeled “key/enc”. You’ll see the keyword “open” in one example and the keyword “restricted” in another. You might have to try each of these if you don’t know which to use. Although in the man pages, the “open” example doesn’t have a key, you can add the key just like in the “restricted” example.

example:
iwconfig eth1 essid MyAccessPoint key open c2fccef3d1