Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1012,7 +1012,7 @@ UPDATE_DYNDNS(){
|
||||
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
|
||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}${NEWIP}"
|
||||
|
||||
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then
|
||||
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${OLDIP}" != *";"* ]] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then
|
||||
[ "${2}" != 'q' ] && echo && echo -en "${idsCL[Green]}${1^} WAN IP has changed, updating records ... "
|
||||
if [ "${1}" == "home" ]; then
|
||||
/usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||
@@ -1030,8 +1030,8 @@ UPDATE_DYNDNS(){
|
||||
SENDNOTICE "${1^^} DYNDNS Updated" "Updated ${1^} WAN IP from '${OLDIP}' to '${NEWIP}'"
|
||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}done${idsCL[Default]}"
|
||||
|
||||
elif [[ "${NEWIP}" == *";"* ]]; then
|
||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could reach any servers${idsCL[Default]}"
|
||||
elif [[ "${NEWIP}" == *";"* ]] || [[ "${OLDIP}" == *";"* ]]; then
|
||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could not do dns lookup${idsCL[Default]}"
|
||||
# SENDNOTICE "${1^^} DYNDNS Could not Update" "Connection error, could reach any servers"
|
||||
elif [ "${OLDIP}" == "" ]; then
|
||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could not get OLD IP${idsCL[Default]}"
|
||||
|
||||
Reference in New Issue
Block a user