Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1012,7 +1012,7 @@ UPDATE_DYNDNS(){
|
|||||||
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
|
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}${NEWIP}"
|
[ "${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 ... "
|
[ "${2}" != 'q' ] && echo && echo -en "${idsCL[Green]}${1^} WAN IP has changed, updating records ... "
|
||||||
if [ "${1}" == "home" ]; then
|
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
|
/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}'"
|
SENDNOTICE "${1^^} DYNDNS Updated" "Updated ${1^} WAN IP from '${OLDIP}' to '${NEWIP}'"
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}done${idsCL[Default]}"
|
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}done${idsCL[Default]}"
|
||||||
|
|
||||||
elif [[ "${NEWIP}" == *";"* ]]; then
|
elif [[ "${NEWIP}" == *";"* ]] || [[ "${OLDIP}" == *";"* ]]; then
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could reach any servers${idsCL[Default]}"
|
[ "${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"
|
# SENDNOTICE "${1^^} DYNDNS Could not Update" "Connection error, could reach any servers"
|
||||||
elif [ "${OLDIP}" == "" ]; then
|
elif [ "${OLDIP}" == "" ]; then
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could not get OLD IP${idsCL[Default]}"
|
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could not get OLD IP${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user