diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index adc3fc5a..6b165a04 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -253,6 +253,27 @@ else fi } ++setDNS() + +{ + +DNSChoseCmd=(whiptail --separate-output --radiolist "Select DNS Servers" $r $c 2) + +DNSChooseOptions=(Google "Use Google's DNS Servers" on + + DynDNS "Use DynDNS's DNS Servers" off) + +DNSchoices=$("${DNSChoseCmd[@]}" "${DNSChooseOptions[@]}" 2>&1 >/dev/tty) + + + +case $DNSchoices in + + Google) + + echo "Google selected." + + piholeDNS1="8.8.8.8" + + piholeDNS2="8.8.4.4" + + ;; + + DynDNS) + + echo "DynDNS selected." + + piholeDNS1="208.67.222.222" + + piholeDNS2="208.67.220.220" + + ;; + +esac + +} + installScripts(){ $SUDO echo " " $SUDO echo "::: Installing scripts..." @@ -279,6 +300,8 @@ if grep -q $dnsSearch $dnsFile; then fi $SUDO curl -o /etc/dnsmasq.d/01-pihole.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/01-pihole.conf $SUDO sed -i "s/@INT@/$piholeInterface/" /etc/dnsmasq.d/01-pihole.conf +$SUDO sed -i "s/@DNS1@/$piholeDNS1/" /etc/dnsmasq.d/01-pihole.conf ++$SUDO sed -i "s/@DNS2@/$piholeDNS2/" /etc/dnsmasq.d/01-pihole.conf } installConfigs(){ @@ -422,6 +445,8 @@ chooseInterface # Let the user decide if they want to block ads over IPv4 and/or IPv6 use4andor6 +# Decide what upstream DNS Servers to use +setDNS # Install and log everything to a file installPihole | tee $tmpLog