Get interface of AP from hostapd config file

This commit is contained in:
zbchristian 2020-06-03 23:33:43 +02:00 committed by GitHub
parent d13c77bd2f
commit e390c00a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -5,8 +5,8 @@ if ($arrHostapdConf['WifiAPEnable'] == 1) {
} else { } else {
$client_iface = RASPI_WIFI_CLIENT_INTERFACE; $client_iface = RASPI_WIFI_CLIENT_INTERFACE;
} }
exec('cat '.RASPI_HOSTAPD_CONFIG.' | sed -rn "s/interface=(wlan[0-9])/\1/p" ',$ap_iface); $pars=parse_ini_file(RASPI_HOSTAPD_CONFIG,false,INI_SCANNER_RAW );
$ap_iface = $ap_iface[0]; $ap_iface = $pars['interface'];
$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"'; $MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
if ($arrHostapdConf['BridgedEnable'] == 1) { if ($arrHostapdConf['BridgedEnable'] == 1) {
$moreLink = "index.php?page=hostapd_conf"; $moreLink = "index.php?page=hostapd_conf";