raspberry wifi fix (wip)
This commit is contained in:
parent
4bde7561a6
commit
3781d3c219
@ -179,7 +179,7 @@
|
||||
<li><span class="code">uuid()</span>: added MACs</li>
|
||||
<li><span class="code">uuid()</span>: better Raspberry Pi hardware ID</li>
|
||||
<li><span class="code">getData()</span>: support for passing parameters and filters (see <a href="general.html">section General / getData</a>)</li>
|
||||
<li><span class="code">Apple M1 Silicon</span> extended support (now ereything supported exept of cpu temperature)</li>
|
||||
<li><span class="code">Apple M1 Silicon</span> extended support (now everything supported except of cpu temperature)</li>
|
||||
<li>updated TypeScript definitions </li>
|
||||
</ul>
|
||||
<h4>Test full functionality and view Version 5 results</h4>
|
||||
|
||||
@ -201,7 +201,7 @@
|
||||
</div>
|
||||
<div class="row number-section">
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">12,898</div>
|
||||
<div class="numbers">13,024</div>
|
||||
<div class="title">Lines of code</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
@ -209,7 +209,7 @@
|
||||
<div class="title">Downloads last month</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">375</div>
|
||||
<div class="numbers">376</div>
|
||||
<div class="title">Dependents</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
20
lib/wifi.js
20
lib/wifi.js
@ -154,8 +154,8 @@ function wifiNetworks(callback) {
|
||||
iface = iwconfigParts[i].split(' ')[0];
|
||||
}
|
||||
}
|
||||
if (iface()) {
|
||||
let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} sscan 2>/dev/null; unset LC_ALL`).toString().split(' Cell ');
|
||||
if (iface) {
|
||||
let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>/dev/null; unset LC_ALL`).toString().split(' Cell ');
|
||||
if (iwlistParts.length > 1) {
|
||||
iwlistParts.shift();
|
||||
for (let i = 0; i < iwlistParts.length; i++) {
|
||||
@ -180,7 +180,7 @@ function wifiNetworks(callback) {
|
||||
let wpaFlag = '';
|
||||
lines.forEach(function (line) {
|
||||
const l = line.trim().toLowerCase();
|
||||
if (l.indexOf('group cipher')) {
|
||||
if (l.indexOf('group cipher') >= 0) {
|
||||
if (wpaFlag) {
|
||||
wpaFlags.push(wpaFlag);
|
||||
}
|
||||
@ -189,19 +189,19 @@ function wifiNetworks(callback) {
|
||||
wpaFlag = parts[1].trim();
|
||||
}
|
||||
}
|
||||
if (l.indexOf('pairwise cipher')) {
|
||||
if (l.indexOf('pairwise cipher') >= 0) {
|
||||
const parts = l.split(':');
|
||||
if (parts.length > 1) {
|
||||
if (parts[i].indexOf('tkip')) { wpaFlag = wpaFlag ? 'TKIP/' + wpaFlag : 'TKIP'; }
|
||||
else if (parts[i].indexOf('ccmp')) { wpaFlag = wpaFlag ? 'CCMP/' + wpaFlag : 'CCMP'; }
|
||||
else if (parts[i].indexOf('proprietary')) { wpaFlag = wpaFlag ? 'PROP/' + wpaFlag : 'PROP'; }
|
||||
if (parts[i].indexOf('tkip')) { wpaFlag = (wpaFlag ? 'TKIP/' + wpaFlag : 'TKIP'); }
|
||||
else if (parts[i].indexOf('ccmp')) { wpaFlag = (wpaFlag ? 'CCMP/' + wpaFlag : 'CCMP'); }
|
||||
else if (parts[i].indexOf('proprietary')) { wpaFlag = (wpaFlag ? 'PROP/' + wpaFlag : 'PROP'); }
|
||||
}
|
||||
}
|
||||
if (l.indexOf('Authentication Suites')) {
|
||||
if (l.indexOf('authentication suites') >= 0) {
|
||||
const parts = l.split(':');
|
||||
if (parts.length > 1) {
|
||||
if (parts[i].indexOf('802.1x')) { wpaFlag = wpaFlag ? '802.1x/' + wpaFlag : '802.1x'; }
|
||||
else if (parts[i].indexOf('psk')) { wpaFlag = wpaFlag ? 'PSK/' + wpaFlag : 'PSK'; }
|
||||
if (parts[i].indexOf('802.1x')) { wpaFlag = (wpaFlag ? '802.1x/' + wpaFlag : '802.1x'); }
|
||||
else if (parts[i].indexOf('psk')) { wpaFlag = (wpaFlag ? 'PSK/' + wpaFlag : 'PSK'); }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user