Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1010,11 +1010,10 @@ UPDATE_DYNDNS(){
|
|||||||
echo -en "${idsCL[LightCyan]}New IP ${idsCL[White]}: "
|
echo -en "${idsCL[LightCyan]}New IP ${idsCL[White]}: "
|
||||||
fi
|
fi
|
||||||
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
|
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
|
||||||
if [ "${2}" != 'q' ]; then
|
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}${NEWIP}"
|
||||||
echo -e "${idsCL[Green]}${NEWIP}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then
|
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then
|
||||||
|
[ "${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
|
||||||
/usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
@@ -1028,12 +1027,12 @@ UPDATE_DYNDNS(){
|
|||||||
/usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
|
|
||||||
fi
|
fi
|
||||||
SENDNOTICE "Updated ${1^} WAN IP from '${OLDIP}' to '${NEWIP}'" "${1^^} DYNDNS Updated"
|
SENDNOTICE "${1^^} DYNDNS Updated" "Updated ${1^} WAN IP from '${OLDIP}' to '${NEWIP}'"
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}Updated ${1^} WAN IP successful${idsCL[Default]}"
|
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}done${idsCL[Default]}"
|
||||||
|
|
||||||
elif [[ "${NEWIP}" == *";"* ]]; then
|
elif [[ "${NEWIP}" == *";"* ]]; then
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could reach any servers${idsCL[Default]}"
|
[ "${2}" != 'q' ] && echo -e "${idsCL[Red]}Could reach any servers${idsCL[Default]}"
|
||||||
# SENDNOTICE "Connection error, could reach any servers" "${1^^} DYNDNS Could not Update"
|
# 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]}"
|
||||||
elif [ "${NEWIP}" == "" ]; then
|
elif [ "${NEWIP}" == "" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user