#!/bin/bash read -p "IP for the upstream dns server: " UpStreamDNS1 while true; do read -p "Add seconndary upstream dns server Y/N? " yn case $yn in [Yy]* ) read -p "IP for second the upstream dns server: " UpStreamDNS2;break;; [Nn]* ) UpStreamDNS2=$UpStreamDNS1;break;; * ) echo "Please answer yes or no.";; esac done sed -i "/upstreams = \[/,/\]/c\upstreams = [ \"$UpStreamDNS1\" , \"$UpStreamDNS2\" ]" /etc/pihole/pihole.toml #Finialize instaltation /etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended #Set password pihole setpassword