Update nodemgmt-scripts.sh

This commit is contained in:
2022-02-02 18:22:28 -06:00
parent 2e307cfee4
commit bf9efa72a3

View File

@@ -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 ""