Replace interface constant with _SESSION value

This commit is contained in:
billz
2020-06-07 14:25:28 +01:00
parent 677a6c52b0
commit b14175ab0c
5 changed files with 22 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
<?php
require_once 'functions.php';
require_once 'hostapd.php';
function knownWifiStations(&$networks)
{
@@ -53,10 +54,10 @@ function nearbyWifiStations(&$networks, $cached = true)
$scan_results = cache(
$cacheKey, function () {
exec('sudo wpa_cli -i ' . RASPI_WIFI_CLIENT_INTERFACE . ' scan');
exec('sudo wpa_cli -i ' .$_SESSION['client_iface']. ' scan');
sleep(3);
exec('sudo wpa_cli -i ' . RASPI_WIFI_CLIENT_INTERFACE . ' scan_results', $stdout);
exec('sudo wpa_cli -i ' .$_SESSION['client_iface']. ' scan_results', $stdout);
array_shift($stdout);
return implode("\n", $stdout);