From bf9efa72a3ba186246937393222390f70e60d3bc Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 2 Feb 2022 18:22:28 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 5af37d78..0d342864 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1728,6 +1728,24 @@ ADD_LOGROTATE_CRONTAB(){ read -n 1 -s -p "Press any key to continue" } +UPDATE_DYNDNS(){ + echo -en "${idsCL[LightCyan]}Updating Primary DNS A records with any WAN IP changes... ${idsCL[Default]}" + + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=sc1.scity.us&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=scity.us&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=sc2.scity.us&myip=`dig +short myip.opendns.com @resolver2.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=scity.xyz&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=schroedercity.com&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=dasrei.com&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=dasrp.com&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=snsinvest.com&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=misfitsmc.com&myip=`dig +short myip.opendns.com @resolver1.opendns.com`" + + echo -e "${idsCL[Green]}Done${idsCL[Default]}" + echo "" + read -n 1 -s -p "Press any key to continue" +} + RUN_COMMAND(){ echo "${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14}" for NTYPE in "${NODE_TYPES[@]}"; do @@ -1768,6 +1786,7 @@ GUI(){ echo " [8] Set folder permissions on nodes" echo " [9] Backup Node Settings and Files" echo "" + echo " [D] Update Primary DNS Records" echo " [R] Add cron task to rotate wtmp & btmp log files" echo "" echo " [Q] Quit" @@ -1786,6 +1805,7 @@ GUI(){ 7) LISTCERTS; GUI;; 8) SET-PERMISSIONS; GUI;; 9) BACKUP; GUI;; + [Dd]) UPDATE_DYNDNS; GUI;; [Rr]) ADD_LOGROTATE_CRONTAB; GUI;; [Qq]) EXIT1 exit 0;; @@ -1811,6 +1831,7 @@ if [ ${action-x} ]; then newsite) NEWSITE ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15};; update) ;; update-nodes) NODEUPDATE ${2};; + update-dyndns) UPDATE_DYNDNS;; backup) BACKUP;; status) if [ "${2}" = "report" ]; then @@ -1871,6 +1892,7 @@ if [ ${action-x} ]; then echo -e " ${idsCL[Yellow]}status${idsCL[Default]}" echo -e " ${idsCL[Yellow]}status-check${idsCL[Default]}" echo -e " ${idsCL[Yellow]}update-nodes${idsCL[Default]}" + echo -e " ${idsCL[Yellow]}update-dyndns${idsCL[Default]}" echo -e " ${idsCL[Yellow]}vc-ssl${idsCL[Default]}" echo -e "}" echo ""