mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Added getWifiInterface
This commit is contained in:
parent
b14175ab0c
commit
e3c378427b
1 changed files with 14 additions and 1 deletions
|
@ -92,10 +92,23 @@ function nearbyWifiStations(&$networks, $cached = true)
|
|||
|
||||
function connectedWifiStations(&$networks)
|
||||
{
|
||||
exec('iwconfig ' . RASPI_WIFI_CLIENT_INTERFACE, $iwconfig_return);
|
||||
exec('iwconfig ' .$_SESSION['client_iface'], $iwconfig_return);
|
||||
foreach ($iwconfig_return as $line) {
|
||||
if (preg_match('/ESSID:\"([^"]+)\"/i', $line, $iwconfig_ssid)) {
|
||||
$networks[$iwconfig_ssid[1]]['connected'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getWifiInterface()
|
||||
{
|
||||
if (empty($_SESSION['client_iface'])) {
|
||||
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
|
||||
if (isset($arrHostapdConf['WifiInterface'])) {
|
||||
$_SESSION['client_iface'] = $arrHostapdConf['WifiInterface'];
|
||||
} else { // fallback to default
|
||||
$_SESSSION['client_iface'] = RASPI_WIFI_CLIENT_INTERFACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue