Message ID | 20200311171105.3558036-5-fabian@blaese.de |
---|---|
State | Superseded |
Headers | show |
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 378896e..9905297 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 @@ <table class="wifitable"> <tr> <th>Name</th> - <th>Kanal</th> + <th>Frequenz</th> <th>Signal</th> - <th>Typ</th> <th>MAC</th> - <th>Encryption</th> </tr> <% -iwinfo w2mesh scan |\ - awk -v RS='' \ - '{r = gensub(/.*Address: ([0-9A-F:]*)?.*ESSID: "?([^"\n]*)"?.*Mode: ([^ ]*).*Channel: ([0-9]*).*Signal: (-[0-9]*) dBm.*Encryption: ([^"]*).*/, \ - "<!-- \\5 --><tr><td>\\2</td><td>\\4</td><td>\\5 dBm</td><td>\\3</td><td>\\1</td><td>\\6</td></tr>", "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]*).*/, "<!-- \\3 --><tr><td>\\4</td><td>\\2 MHz</td><td>\\3 dBm</td><td>\\1</td></tr>", "g"); print r;}' | sort -n | sed 's#&#\&#' # The HTML comment contains the signal quality to allow sorting %> </table>
Hi Fabian, Reviewed-by: Robert Langhammer <rlanghammer@web.de> Am 11.03.20 um 18:11 schrieb Fabian Bläse: > 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 <fabian@blaese.de> > --- > .../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 378896e..9905297 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 @@ > <table class="wifitable"> > <tr> > <th>Name</th> > - <th>Kanal</th> > + <th>Frequenz</th> > <th>Signal</th> > - <th>Typ</th> > <th>MAC</th> > - <th>Encryption</th> > </tr> > > <% > -iwinfo w2mesh scan |\ > - awk -v RS='' \ > - '{r = gensub(/.*Address: ([0-9A-F:]*)?.*ESSID: "?([^"\n]*)"?.*Mode: ([^ ]*).*Channel: ([0-9]*).*Signal: (-[0-9]*) dBm.*Encryption: ([^"]*).*/, \ > - "<!-- \\5 --><tr><td>\\2</td><td>\\4</td><td>\\5 dBm</td><td>\\3</td><td>\\1</td><td>\\6</td></tr>", "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]*).*/, "<!-- \\3 --><tr><td>\\4</td><td>\\2 MHz</td><td>\\3 dBm</td><td>\\1</td></tr>", "g"); print r;}' | sort -n | sed 's#&#\&#' > # The HTML comment contains the signal quality to allow sorting > %> > </table>
Hi, ich würde nach wie vor lieber simple-tc entfernen und iwinfo behalten, aber da das hier auch eine funktionierende Lösung zu sein scheint bin ich damit einverstanden und würde das erstmal so durchziehen. Den Code für's WebUI habe ich mir nicht näher angeschaut, aber das ist denke ich so auch okay. Ich würde anstreben, dass 19.07 Zeug jetzt zeitnah alles reinzuwerfen und zur Not dann noch ein bisschen nachzupolieren. Grüße Adrian > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf > Of Fabian Bläse > Sent: Mittwoch, 11. März 2020 18:11 > To: franken-dev@freifunk.net > Subject: [PATCH 4/5] fff-web: Use iw instead of iwinfo for wifiscan > > 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 <fabian@blaese.de> > --- > .../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 378896e..9905297 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 @@ > <table class="wifitable"> > <tr> > <th>Name</th> > - <th>Kanal</th> > + <th>Frequenz</th> > <th>Signal</th> > - <th>Typ</th> > <th>MAC</th> > - <th>Encryption</th> > </tr> > > <% > -iwinfo w2mesh scan |\ > - awk -v RS='' \ > - '{r = gensub(/.*Address: ([0-9A-F:]*)?.*ESSID: "?([^"\n]*)"?.*Mode: > ([^ ]*).*Channel: ([0-9]*).*Signal: (-[0-9]*) dBm.*Encryption: ([^"]*).*/, \ > - "<!-- \\5 --><tr><td>\\2</td><td>\\4</td><td>\\5 > dBm</td><td>\\3</td><td>\\1</td><td>\\6</td></tr>", "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]*).*/, "<!-- \\3 -- > ><tr><td>\\4</td><td>\\2 MHz</td><td>\\3 dBm</td><td>\\1</td></tr>", > "g"); print r;}' | sort -n | sed 's#&#\&#' > # The HTML comment contains the signal quality to allow sorting %> > </table> > -- > 2.25.1
Hey, On 15.03.20 13:26, mail@adrianschmutzler.de wrote: > ich würde nach wie vor lieber simple-tc entfernen und iwinfo behalten, aber da das hier auch eine funktionierende Lösung zu sein scheint bin ich damit einverstanden und würde das erstmal so durchziehen. simple-tc wird halt von Leuten benutzt, iwinfo normalerweise (mit dem angepassten WebUI) nicht. > Den Code für's WebUI habe ich mir nicht näher angeschaut, aber das ist denke ich so auch okay. Es tut das gleiche mit folgenden ausnahmen: - Frequenz statt Kanal (z.B. 2412 statt 1) - Kein Mode (z.B. "Master", "Ad-Hoc") - Keine Encryption (z.B. WPA2) > Ich würde anstreben, dass 19.07 Zeug jetzt zeitnah alles reinzuwerfen und zur Not dann noch ein bisschen nachzupolieren. Ebenso. Gruß Fabian
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 <fabian@blaese.de> --- .../fff/fff-web/files/www/ssl/cgi-bin/wifiscan.html | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)