Update nodemgmt-scripts.sh
This commit is contained in:
@@ -527,7 +527,7 @@ UPDATE_DYNDNS(){
|
||||
cw_spc=10
|
||||
echo -e "${idsCL[Yellow]}Checking for DYNDNS update at '${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}'${idsCL[Default]}"
|
||||
echo
|
||||
echo -en "${idsCL[White]}Previous WAN IP ${idsCL[White]}: "
|
||||
echo -en "${idsCL[White]}Previous WAN IP : "
|
||||
|
||||
if [ "${LOCATION}" == "mainsite" ]; then
|
||||
OLDIP=`dig +short sc1.scity.us @wdns.scity.us +time=2`
|
||||
@@ -537,7 +537,7 @@ UPDATE_DYNDNS(){
|
||||
OLDIP=`dig +short wan.pattonfam.com @wdns.scity.us +time=2`
|
||||
fi
|
||||
echo -e "${idsCL[Cyan]}${OLDIP}"
|
||||
echo -en "${idsCL[White]}Current WAN IP ${idsCL[White]}: "
|
||||
echo -en "${idsCL[White]}Current WAN IP : "
|
||||
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com +time=2`
|
||||
echo -e "${idsCL[Green]}${NEWIP}"
|
||||
echo
|
||||
@@ -547,7 +547,7 @@ 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[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has not changed... but what the heck, lets update the records anyway ehh ... "
|
||||
echo -en "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has not changed... ${idsCL[Green]}but what the heck, lets update the records anyway ehh ... "
|
||||
else
|
||||
echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... "
|
||||
fi
|
||||
@@ -580,14 +580,14 @@ UPDATE_DYNDNS(){
|
||||
fi
|
||||
|
||||
elif [[ "${NEWIP}" == *";"* ]] || [[ "${OLDIP}" == *";"* ]]; then
|
||||
echo -e "${idsCL[Red]}Could not perform DNS Lookups${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightRed]}Could not perform DNS Lookups${idsCL[Default]}"
|
||||
# SENDNOTICE "${LOCATION^^} DYNDNS Could not Update" "Connection error, could reach any servers"
|
||||
elif [ "${OLDIP}" == "" ]; then
|
||||
echo -e "${idsCL[Red]}Could not get Previous WAN IP${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightRed]}Could not get Previous WAN IP${idsCL[Default]}"
|
||||
elif [ "${NEWIP}" == "" ]; then
|
||||
echo -e "${idsCL[Red]}Could not get Current WAN IP${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightRed]}Could not get Current WAN IP${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has not changed${idsCL[Default]}"
|
||||
echo -e "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has not changed${idsCL[Default]}"
|
||||
fi
|
||||
else
|
||||
[ "${LOCATION}" == "" ] && echo -e "\n${idsCL[Red]}No DYNDNS location specified" || echo -e "\n${idsCL[Red]}DYNDNS location '${LOCATION}' not recognized"
|
||||
|
||||
Reference in New Issue
Block a user