Update nodemgmt-scripts.sh

This commit is contained in:
2023-11-15 08:40:40 -06:00
parent 266114fde9
commit 8b04117bb9

View File

@@ -526,17 +526,17 @@ UPDATE_DYNDNS(){
echo -e "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed: ${idsCL[Yellow]}testmode active and will not update records${idsCL[Default]}"
else
if [ ${FORCE} -eq 1 ]; then
echo -en "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Yellow]}' WAN IP has not changed...\n${idsCL[Green]}but what the heck, lets update the records anyway ehh ... "
echo -e "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Yellow]}' WAN IP has not changed...\n${idsCL[Green]}but what the heck, lets update the records anyway ehh ... "
else
SENDNOTICE "${LOCATION^^} WAN IP Changed" "Updated '${LOCATION^}' WAN IP from '${OLDIP}' to '${NEWIP}'"
echo -e "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... "
echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... "
fi
if [ "${NM_DYNUSER}" != "" ] && [ "${NM_DYNPASS}" != "" ]; then
if [ "$(/usr/bin/curl -m 3 -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update")" != "" ]; then
for host in ${DYNDNS_HOSTS[@]}; do
echo "updating: $host"
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=${host}&myip=${NEWIP}" > /dev/null 2>&1
done
if [ "$(curl -m 3 -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@wdns.scity.us/domain/${domain}" | grep "HTTP 403 Error")" == "" ]; then
# for host in ${DYNDNS_HOSTS[@]}; do
# echo "updating: $host"
# /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=${host}&myip=${NEWIP}" > /dev/null 2>&1
# done
[ "${LOCATION,,}" == "mainsite" ] && /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
else