From 633f389f4ed967deeabb87deedef6c5416c7f469 Mon Sep 17 00:00:00 2001 From: zbchristian <33725910+zbchristian@users.noreply.github.com> Date: Tue, 9 Jun 2020 10:15:21 +0200 Subject: [PATCH] Check for second wifi interface as wifi client --- includes/wifi_functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/wifi_functions.php b/includes/wifi_functions.php index 2969c517..f907536c 100755 --- a/includes/wifi_functions.php +++ b/includes/wifi_functions.php @@ -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; }