BashfulBladder / gargoyle-plugins

9 stars 7 forks source link

Plugin not work after upgrade wifi drivers - presentation iw dev wlan0 scan has cahnged #6

Closed roblad closed 10 years ago

roblad commented 10 years ago

Hi,] Plugin does not work. problem identified is:

(on - it is given as presentation of MAC as addition.

after testing

iw dev wlan0 scan

BBS currently is shown as below

BSS 00:23:cd:c5:a6:04(on wlan0)

your script survey.sh in line 31 begins with MAC presentation through awk

problem is in

shvars=`awk '/^BSS/ {print "MAC="$2}

shvars=awk '/^BSS/ {print "MAC="$2}/\tfreq:/{split($2, c, "");print "Freq="c[1]"."c[2]c[3]c[4]} /\tsignal:/ {printf "Level=%i\n", $2} /\tcapability:/ {for(i=2;i<=NF;++i) if($i=="IBSS") print "Mode=\"Ad Hoc\""; else if ($i=="ESS") print "Mode=Station"; else if ($i=="Privacy") print "Privacy=on"} /\tSSID:/ {printf "SSID=\""; for(i=2;i<=NF;++i) printf("%s%s", $i, i==NF?"\"\n":" ") } /\tSupported rates:/ {printf "sRate=%i\n", $NF} /\tDS Parameter set:/ {print "Channel="$NF} /\tExtended supported rates:/ {printf "eRate=%i\n", $NF} /\tHT capabilities:/,/DSSS/ {for(i=2;i<=NF;++i) if ($i == "HT40") print "HTmode="$i } /rate indexes supported:/ {print "rates="$NF} /spatial streams:/ {print "streams="$NF} /secondary channel offset:/ {print "channeloffset="$NF} /channel width:/ {print "channelwidth="$5} /\tWPA:/,/Authentication suites:/ {for(i=2;i<=NF;++i) if ($i == "Version:") print "WPA=WPA"$i+1 ; else if ($i == "Group") print "Gcipher1="$(i+2); else if ($i == "Pairwise") {printf "Pcipher1="; for(j=4;j<=NF;j++) printf("%s%s", $j, j==NF?"\n":",")} else if ($i == "Authentication") {print "AuthSuites1="$NF}} /\tRSN:/,/Capabilities:/ {for(i=2;i<=NF;++i) if ($i == "Version:") print "WPA2=WPA2v"$i+1 ; else if ($i == "Group") print "Gcipher2="$(i+2); else if ($i == "Pairwise") {printf "Pcipher2="; for(j=4;j<=NF;j++) printf("%s%s", $j, j==NF?"\n":",")} else if ($i == "Authentication") {print "AuthSuites2="$NF}}' "$sta_dir"/$station

roblad commented 10 years ago

from

awk '/^BSS/ {print "MAC=" $2}

to

awk -F '[(, ,)]' '/^BSS/ {print "MAC=" $2}

line 72

shvars=`awk -F '[ :=]+' '/Address/{print"MAC="substr($0,30)

to

shvars=`awk -F '[ :=]+' '/Address/{print"MAC="substr($0,28)

solved problem

BashfulBladder commented 10 years ago

The 2nd patch doesn't look to be needed: iwlist hasn't been changed or been updated in a long time.

There were some problems with changing the awk field separator in the 1st patch: sRate=0 (should be 18 for example) eRate=0 (should be 54 for example) Pcipher2=ciphers:,CCMP (should be just CCMP) channelwidth=width: (should be something like any)

this should work:

awk '/^BSS/ {split($2,M,"[(, ]"); print "MAC="M[1]}