From bcdadd3d430266f3ceae76270684ba37927b5464 Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 4 Nov 2019 10:04:11 +0000 Subject: [PATCH] Parse/set static ip_address value for uap0. #329 --- includes/hostapd.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/hostapd.php b/includes/hostapd.php index 7e34a4b6..2a5f0350 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -239,18 +239,20 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status) // Set dnsmasq values from ini, fallback to default if undefined $intConfig = parse_ini_file(RASPI_CONFIG_NETWORKING.'/'.RASPI_WIFI_CLIENT_INTERFACE.'.ini', false, INI_SCANNER_RAW); - $ip_address = ($intConfig['ip_address'] == '') ? '10.3.141.1/24' : $intConfig['ip_address']; $domain_name_server = ($intConfig['domain_name_server'] =='') ? '1.1.1.1 8.8.8.8' : $intConfig['domain_name_server']; $routers = ($intConfig['routers'] == '') ? '10.3.141.1' : $intConfig['routers']; if ($wifiAPEnable == 1) { // Enable uap0 configuration in dhcpcd for Wifi client AP mode + $intConfig = parse_ini_file(RASPI_CONFIG_NETWORKING.'/uap0.ini', false, INI_SCANNER_RAW); + $ip_address = ($intConfig['ip_address'] == '') ? '192.168.50.1/24' : $intConfig['ip_address']; $config = PHP_EOL.'# RaspAP uap0 configuration'.PHP_EOL; $config.= 'interface uap0'.PHP_EOL; - $config.= 'static ip_address=192.168.50.1/24'.PHP_EOL; + $config.= 'static ip_address='.$ip_address.PHP_EOL; $config.= 'nohook wpa_supplicant'.PHP_EOL; } else { // Default config + $ip_address = ($intConfig['ip_address'] == '') ? '10.3.141.1/24' : $intConfig['ip_address']; $config = '# RaspAP wlan0 configuration'.PHP_EOL; $config.= 'hostname'.PHP_EOL; $config.= 'clientid'.PHP_EOL;