For some strange unknown reason, since I changed ISP and started using a different SpeedTouch wireless access point, my Internet connection occasionally gets drop. My wi0 driver doesn't reconnect like it is supposed to which is pretty aggravating to say the least.
So when this happens I can use a simple script that I wrote which will in one go reconnect everything like magic as if nothing happened in the first place. Here it is:
#!/bin/sh
echo "Configuring wi0 for home ..."
ifconfig wi0 down
ifconfig wi0 media autoselect
ifconfig wi0 channel 1
ifconfig wi0 ssid [SSID goes here...]
ifconfig wi0 authmode open
ifconfig wi0 wepmode on
ifconfig wi0 weptxkey 1
ifconfig wi0 wepkey 0x[wepkey goes here...]
ifconfig wi0 up
dhclient wi0