From 0c3429f3fbc83c7321a9264eca870c53f538c67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 11 Mar 2020 01:47:29 +0100 Subject: [PATCH] fff-web: Use iw instead of iwinfo for wifiscan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares the fff-web package for removal of the iwinfo binary. Instead of using the 'iwinfo' wrapper, the nl80211 utility 'iw' is used from now on, which is possible, because we only support devices with nl80211 drivers anyway. Because iw reports the frequency instead of the channel, and does not allow easily parsing the mode and encryption parameters, the table is adjusted accordingly. Signed-off-by: Fabian Bläse Reviewed-by: Robert Langhammer --- .../fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html index 378896e8..99052971 100755 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html @@ -8,18 +8,14 @@ - + - - <% -iwinfo w2mesh scan |\ - awk -v RS='' \ - '{r = gensub(/.*Address: ([0-9A-F:]*)?.*ESSID: "?([^"\n]*)"?.*Mode: ([^ ]*).*Channel: ([0-9]*).*Signal: (-[0-9]*) dBm.*Encryption: ([^"]*).*/, \ - "", "g"); print r;}' | sort -n | sed 's#&#\&#' +iw dev w2mesh scan | sed 's/^BSS/\nBSS/g' |\ + awk -v RS='' '{r = gensub(/.*BSS ([0-9a-f:]*)?.*freq: ([0-9]*).*signal: (-[0-9]*\.[0-9]*) dBm.*SSID: ([^\n]*).*/, "", "g"); print r;}' | sort -n | sed 's#&#\&#' # The HTML comment contains the signal quality to allow sorting %>
NameKanalFrequenz SignalTyp MACEncryption
\\2\\4\\5 dBm\\3\\1\\6
\\4\\2 MHz\\3 dBm\\1