View Single Post
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#183
Hi all,

Few pages back there was several people having problem connecting again to the network after unloading the drivers. Haven't read the complete thread and it might be the case that it has been corrected/found.

In the case it hasn't, the problem comes from the way the mac address is stored when in monitor mode.
i.e. 0C-2B-34-... instead of OC:2B:34...
therefore the unload.sh script fails to read the mac and put it back later.

The solution is easy.

In the unload.sh script, the line:
Code:
MACADDR="`ifconfig wlan0 | sed -n 's/.*HWaddr \([0-9A-Fa-f:]\+\).*/\1/p'`"
needs to replaced with:
Code:
MACADDR="`ifconfig wlan0 | grep wlan0 | awk -F"addr " '{print $2}' | awk -F"-" 'BEGIN {OFS = ":"}; {print $1,$2,$3,$4,$5,$6}'| awk -F" " '{print $1}'`"
Hope it is useful.
 

The Following User Says Thank You to Saturn For This Useful Post: