From a56a59b7e524b43a621909d21b9dab3e34d7b895 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 5 Dec 2020 21:49:32 +0000 Subject: [PATCH] Default config tweaks --- config/090_wlan0.conf | 1 + config/defaults.json | 4 ++-- installers/common.sh | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/090_wlan0.conf b/config/090_wlan0.conf index 31f86eb3..56234784 100644 --- a/config/090_wlan0.conf +++ b/config/090_wlan0.conf @@ -1,5 +1,6 @@ # RaspAP wlan0 configuration for wired (ethernet) AP mode interface=wlan0 +domain-needed dhcp-range=10.3.141.50,10.3.141.255,255.255.255.0,12h dhcp-option=6,1.1.1.1,8.8.8.8 diff --git a/config/defaults.json b/config/defaults.json index 59f6f4a4..24f2138e 100644 --- a/config/defaults.json +++ b/config/defaults.json @@ -13,10 +13,10 @@ }, "dnsmasq": { "wlan0": { - "dhcp-range": [ "10.3.141.50,10.3.141.255,255.255.255.0,12h" ], + "dhcp-range": [ "10.3.141.50,10.3.141.255,255.255.255.0,12h" ] + }, "uap0": { "dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ] } } } - diff --git a/installers/common.sh b/installers/common.sh index 4f000a8e..103f9c9b 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -145,9 +145,10 @@ function _create_raspap_directories() { # Create a directory to store networking configs echo "Creating $raspap_dir/networking" sudo mkdir -p "$raspap_dir/networking" - # Copy existing dhcpcd.conf to use as base config - echo "Adding /etc/dhcpcd.conf as base configuration" - cat /etc/dhcpcd.conf | sudo tee -a /etc/raspap/networking/defaults > /dev/null + + # Copy defaults.json to use as fallback config + sudo cp $webroot_dir/config/defaults.json $raspap_network || _install_status 1 "Unable to move defaults.json settings" + echo "Changing file ownership of $raspap_dir" sudo chown -R $raspap_user:$raspap_user "$raspap_dir" || _install_status 1 "Unable to change file ownership for '$raspap_dir'" } @@ -379,7 +380,6 @@ function _default_configuration() { sudo cp $webroot_dir/config/hostapd.conf /etc/hostapd/hostapd.conf || _install_status 1 "Unable to move hostapd configuration file" sudo cp $webroot_dir/config/090_wlan0.conf $raspap_dnsmasq || _install_status 1 "Unable to move dnsmasq configuration file" sudo cp $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || _install_status 1 "Unable to move dhcpcd configuration file" - sudo cp $webroot_dir/config/defaults.json $raspap_network || _install_status 1 "Unable to move defaults.json settings" echo "Checking for existence of /etc/dnsmasq.d" [ -d /etc/dnsmasq.d ] || sudo mkdir /etc/dnsmasq.d