1
0
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:
zbchristian 2020-06-09 10:15:21 +02:00 committed by GitHub
parent 2814ab5d55
commit 633f389f4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,10 @@ function getWifiInterface()
if (empty($_SESSION['client_iface'])) {
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
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
$_SESSION['client_iface'] = RASPI_WIFI_CLIENT_INTERFACE;
}