mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Check for second wifi interface as wifi client
This commit is contained in:
parent
2814ab5d55
commit
633f389f4e
@ -138,7 +138,10 @@ function getWifiInterface()
|
|||||||
if (empty($_SESSION['client_iface'])) {
|
if (empty($_SESSION['client_iface'])) {
|
||||||
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
|
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
|
||||||
if (isset($arrHostapdConf['WifiInterface'])) {
|
if (isset($arrHostapdConf['WifiInterface'])) {
|
||||||
$_SESSION['client_iface'] = $arrHostapdConf['WifiInterface'];
|
$iface = $arrHostapdConf['WifiInterface'];
|
||||||
|
// check for 2nd wifi interface
|
||||||
|
exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2);
|
||||||
|
$_SESSION['client_iface'] = empty($iface2) ? $iface : trim($iface2[0]);
|
||||||
} else { // fallback to default
|
} else { // fallback to default
|
||||||
$_SESSION['client_iface'] = RASPI_WIFI_CLIENT_INTERFACE;
|
$_SESSION['client_iface'] = RASPI_WIFI_CLIENT_INTERFACE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user