WIP, rewite configs

This commit is contained in:
billz 2019-03-12 00:03:18 +00:00
parent a9cc4a0c2a
commit 7d98d12e3b
1 changed files with 12 additions and 15 deletions

View File

@ -658,8 +658,15 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
exec('echo "'.$config.'" > /tmp/dhcpddata', $temp); exec('echo "'.$config.'" > /tmp/dhcpddata', $temp);
system('sudo cp /tmp/dhcpddata '.RASPI_DNSMASQ_CONFIG, $return); system('sudo cp /tmp/dhcpddata '.RASPI_DNSMASQ_CONFIG, $return);
// Fixed dhcpcd values if ($wifiAPEnable == 1) {
$config = '# RaspAP defaults'.PHP_EOL; // Enable uap0 configuration in dhcpcd for Wifi client AP mode
$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.= 'nohook wpa_supplicant'.PHP_EOL;
} else {
// Default config
$config.= '# RaspAP wlan0 configuration'.PHP_EOL;
$config.= 'hostname'.PHP_EOL; $config.= 'hostname'.PHP_EOL;
$config.= 'clientid'.PHP_EOL; $config.= 'clientid'.PHP_EOL;
$config.= 'persistent'.PHP_EOL; $config.= 'persistent'.PHP_EOL;
@ -670,16 +677,6 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
$config.= 'require dhcp_server_identifier'.PHP_EOL; $config.= 'require dhcp_server_identifier'.PHP_EOL;
$config.= 'slaac private'.PHP_EOL; $config.= 'slaac private'.PHP_EOL;
$config.= 'nohook lookup-hostname'.PHP_EOL; $config.= 'nohook lookup-hostname'.PHP_EOL;
if ($wifiAPEnable == 1) {
// Enable uap0 configuration in dhcpcd for Wifi client AP mode
$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.= 'nohook wpa_supplicant'.PHP_EOL;
} else {
// Default config
$config.= PHP_EOL.'# RaspAP wlan0 configuration'.PHP_EOL;
$config.= 'interface wlan0'.PHP_EOL; $config.= 'interface wlan0'.PHP_EOL;
$config.= 'static ip_address=10.3.141.1/24'.PHP_EOL; $config.= 'static ip_address=10.3.141.1/24'.PHP_EOL;
$config.= 'static routers=10.3.141.1'.PHP_EOL; $config.= 'static routers=10.3.141.1'.PHP_EOL;