Update nodemgmt-scripts.sh

This commit is contained in:
2023-07-01 19:05:47 -05:00
parent 657b6d8a5a
commit 24992daacb

View File

@@ -1001,15 +1001,15 @@ UPDATE_DYNDNS(){
fi
if [ "${1}" == "home" ]; then
OLDIP=`dig +short sc1.scity.us @ns1.scity.us`
OLDIP=`dig +short sc1.scity.us @ns1.scity.us +time=2`
elif [ "${1}" == "offsite" ]; then
OLDIP=`dig +short offsite.scity.us @ns1.scity.us`
OLDIP=`dig +short offsite.scity.us @ns1.scity.us +time=2`
fi
if [ "${2}" != 'q' ]; then
echo -e "${idsCL[Cyan]}${OLDIP}"
echo -en "${idsCL[LightCyan]}New IP ${idsCL[White]}: "
fi
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com +time=2`
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}${NEWIP}"
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${OLDIP}" != *";"* ]] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then