#787 removing fixed DNS from build script

This commit is contained in:
rootzoll
2020-01-20 19:43:25 +01:00
parent 5265db366b
commit 545b2e9f61
2 changed files with 7 additions and 14 deletions

View File

@@ -82,20 +82,6 @@ else
echo "OK running ${baseImage}"
fi
# setting static DNS server
# comment this block out if you are sure that your DNS conf works reliable
# see https://github.com/rootzoll/raspiblitz/issues/322#issuecomment-466733550
dnsconfFile="/etc/dhcpcd.conf"
if [ "${baseImage}" = "ubuntu" ]; then
dnsconfFile="/etc/dhcp/dhcpd.conf"
fi
# comment out any static dns entry if one is active
sudo sed -i "s/^static domain_name_servers=.*/#static domain_name_servers=/g" "$dnsconfFile"
# add new dns config to conf file
echo "static domain_name_servers=1.1.1.1 8.8.8.8" | sudo tee -a "$dnsconfFile"
# reload to activate for following network operations
systemctl daemon-reload
if [ "${baseImage}" = "raspbian" ] || [ "${baseImage}" = "dietpi" ] ; then
# fixing locales for build
# https://github.com/rootzoll/raspiblitz/issues/138

View File

@@ -50,6 +50,13 @@ else
fi
echo ""
dnsconfFile="/etc/dhcpcd.conf"
isUbuntu=$(cat /etc/os-release 2>/dev/null | grep -c 'Ubuntu')
if [ ${isUbuntu} -gt 0 ]; then
echo "# adapting dhcpd.conf path for ubuntu"
dnsconfFile="/etc/dhcp/dhcpd.conf"
fi
# setting DNS address
echo "# Setting DNS server in /etc/dhcpcd.conf ..."
sudo sed -i "s/^static domain_name_servers=.*/static domain_name_servers=${DNSSERVER}/g" /etc/dhcpcd.conf