mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Parse/set static ip_address value for uap0. #329
This commit is contained in:
parent
fdef2a3d7a
commit
bcdadd3d43
@ -239,18 +239,20 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
|
|||||||
|
|
||||||
// Set dnsmasq values from ini, fallback to default if undefined
|
// 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);
|
$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'];
|
$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'];
|
$routers = ($intConfig['routers'] == '') ? '10.3.141.1' : $intConfig['routers'];
|
||||||
|
|
||||||
if ($wifiAPEnable == 1) {
|
if ($wifiAPEnable == 1) {
|
||||||
// Enable uap0 configuration in dhcpcd for Wifi client AP mode
|
// 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 = PHP_EOL.'# RaspAP uap0 configuration'.PHP_EOL;
|
||||||
$config.= 'interface uap0'.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;
|
$config.= 'nohook wpa_supplicant'.PHP_EOL;
|
||||||
} else {
|
} else {
|
||||||
// Default config
|
// Default config
|
||||||
|
$ip_address = ($intConfig['ip_address'] == '') ? '10.3.141.1/24' : $intConfig['ip_address'];
|
||||||
$config = '# RaspAP wlan0 configuration'.PHP_EOL;
|
$config = '# RaspAP wlan0 configuration'.PHP_EOL;
|
||||||
$config.= 'hostname'.PHP_EOL;
|
$config.= 'hostname'.PHP_EOL;
|
||||||
$config.= 'clientid'.PHP_EOL;
|
$config.= 'clientid'.PHP_EOL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user