From 9aec7e019be2580dd6c69b67e84bd49b1989b0cf Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Sun, 19 Jul 2015 23:34:06 -0700 Subject: [PATCH] bugfix: regression: Networks that have not been seen in long time still show up in wifi scan. Regression of changeset:e34b7fcee49c3e2b7eb35aa4fb44b6abdc78b3ad/aredn_ar71xx Having moved to iw for iwinfo we have a regression previous commit. Restore fix that if not seen after 10 seconds signal drops from display. --- files/usr/local/bin/wscan | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/usr/local/bin/wscan b/files/usr/local/bin/wscan index e6a79693..51678171 100755 --- a/files/usr/local/bin/wscan +++ b/files/usr/local/bin/wscan @@ -175,7 +175,7 @@ while(1) { if($line =~ /BSS\s+(([[:xdigit:]]{2}:){5}[[:xdigit:]]{2})/) { - pushAP($signal, $chan, $key, $ssid, $host, $mac, $mode); + if ( $lastseen < 10000 ) { pushAP($signal, $chan, $key, $ssid, $host, $mac, $mode) } $mac = uc $1; $mode = ""; @@ -183,6 +183,7 @@ while(1) $signal = 0; $chan = ""; $key = ""; + $lastseen = 0; } @@ -198,11 +199,12 @@ while(1) if($line =~ /\bfreq: (\d+)/) { $chan = $1 } if($line =~ /\bsignal: ([\d-]+)/) { $signal = $1 } if($line =~ /\bGroup cipher:(.+)/) { $key = $1 } + if($line =~ /\blast seen: (\d+)/) { $lastseen = $1 } } close(FILE); - pushAP($signal, $chan, $key, $ssid, $host, $mac, $mode); + if ( $lastseen < 10000 ) { pushAP($signal, $chan, $key, $ssid, $host, $mac, $mode) } sleep 1 if not scalar @list and $loops != 1; $mac = "";