From 656ba9234b551a693fd8f3b0b0b9004fd6e71e22 Mon Sep 17 00:00:00 2001 From: christian Zeitnitz Date: Tue, 9 Jun 2020 20:53:11 +0200 Subject: [PATCH] Fix intial assignment of $_SESSION['ap_interface'] --- includes/wifi_functions.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/includes/wifi_functions.php b/includes/wifi_functions.php index 62d27c3a..e40a628d 100755 --- a/includes/wifi_functions.php +++ b/includes/wifi_functions.php @@ -144,14 +144,10 @@ function getWifiInterface() { if (empty($_SESSION['ap_interface'])) { $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini'); - if (isset($arrHostapdConf['WifiInterface'])) { - $iface = $_SESSION['ap_interface'] = $arrHostapdConf['WifiInterface']; - // check for 2nd wifi interface -> wifi client on different interface - exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2); - $_SESSION['wifi_client_interface'] = empty($iface2) ? $iface : trim($iface2[0]); - } else { // fallback to default - $_SESSION['ap_interface'] = $_SESSION['wifi_client_interface'] = RASPI_WIFI_AP_INTERFACE; - } + $iface = $_SESSION['ap_interface'] = isset($arrHostapdConf['WifiInterface']) ? $arrHostapdConf['WifiInterface'] : RASPI_WIFI_AP_INTERFACE; + // check for 2nd wifi interface -> wifi client on different interface + exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2); + $_SESSION['wifi_client_interface'] = empty($iface2) ? $iface : trim($iface2[0]); } }