Update update-dns.sh

This commit is contained in:
2024-03-09 15:29:52 -06:00
parent 9732758922
commit f10b7eefdc

View File

@@ -1,43 +1,45 @@
#!/bin/bash #!/bin/bash
if [ -d /opt/idssys/defaults ]; then echo "HERE: ${1}"
source /opt/idssys/defaults/colors.inc
source /opt/idssys/defaults/default.inc
else
source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
fi
if [ -f /etc/netplan/eth0.yaml ]; then # if [ -d /opt/idssys/defaults ]; then
cat /etc/netplan/eth0.yaml # source /opt/idssys/defaults/colors.inc
else # source /opt/idssys/defaults/default.inc
cat /etc/network/interfaces # else
fi # source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
echo # source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
# fi
read -n 1 -p "Do you wish to continue changing the DNS? (Y/n) " choice #
case "$choice" in # if [ -f /etc/netplan/eth0.yaml ]; then
[Nn]) # cat /etc/netplan/eth0.yaml
echo -e "${Green}The DNS servers have NOT been updated${Color_Off}" # else
exit 0 # cat /etc/network/interfaces
;; # fi
# echo
* ) if [ -f /etc/netplan/eth0.yaml ]; then #
sed -i 's/10.10.10.10,10.10.10.11/10.10.10.10,10.10.10.11,10.2.1.2/g' /etc/netplan/eth0.yaml # read -n 1 -p "Do you wish to continue changing the DNS? (Y/n) " choice
# case "$choice" in
/usr/sbin/netplan apply # [Nn])
# echo -e "${Green}The DNS servers have NOT been updated${Color_Off}"
cat /etc/netplan/eth0.yaml # exit 0
else # ;;
sed -i 's/10.10.10.10 10.10.10.11/10.10.10.10 10.10.10.11 10.2.1.2/g' /etc/network/interfaces #
# * ) if [ -f /etc/netplan/eth0.yaml ]; then
/usr/sbin/service networking restart # sed -i 's/10.10.10.10,10.10.10.11/10.10.10.10,10.10.10.11,10.2.1.2/g' /etc/netplan/eth0.yaml
#
cat /etc/network/interfaces # /usr/sbin/netplan apply
fi #
echo -e "${Green}The DNS servers have been updated${Color_Off}" # cat /etc/netplan/eth0.yaml
;; # else
esac # sed -i 's/10.10.10.10 10.10.10.11/10.10.10.10 10.10.10.11 10.2.1.2/g' /etc/network/interfaces
#
# /usr/sbin/service networking restart
#
# cat /etc/network/interfaces
# fi
# echo -e "${Green}The DNS servers have been updated${Color_Off}"
# ;;
# esac
echo echo