mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Added getWifiInterface
This commit is contained in:
parent
b14175ab0c
commit
e3c378427b
@ -92,10 +92,23 @@ function nearbyWifiStations(&$networks, $cached = true)
|
|||||||
|
|
||||||
function connectedWifiStations(&$networks)
|
function connectedWifiStations(&$networks)
|
||||||
{
|
{
|
||||||
exec('iwconfig ' . RASPI_WIFI_CLIENT_INTERFACE, $iwconfig_return);
|
exec('iwconfig ' .$_SESSION['client_iface'], $iwconfig_return);
|
||||||
foreach ($iwconfig_return as $line) {
|
foreach ($iwconfig_return as $line) {
|
||||||
if (preg_match('/ESSID:\"([^"]+)\"/i', $line, $iwconfig_ssid)) {
|
if (preg_match('/ESSID:\"([^"]+)\"/i', $line, $iwconfig_ssid)) {
|
||||||
$networks[$iwconfig_ssid[1]]['connected'] = true;
|
$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…
x
Reference in New Issue
Block a user