Update nodemgmt-scripts.sh
This commit is contained in:
@@ -517,7 +517,7 @@ UPDATE_DYNDNS(){
|
|||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
if [ "${LOCATION}" == "mainsite" ] || [ "${LOCATION}" == "offsite" ] || [ "${LOCATION}" == "kyle" ]; then
|
if [ "${LOCATION,,}" == "mainsite" ] || [ "${LOCATION,,}" == "offsite" ] || [ "${LOCATION,,}" == "kyle" ]; then
|
||||||
echo
|
echo
|
||||||
if [ "${NM_DYNUSER}" == "" ] || [ "${NM_DYNPASS}" == "" ]; then
|
if [ "${NM_DYNUSER}" == "" ] || [ "${NM_DYNPASS}" == "" ]; then
|
||||||
echo "Missing DYNDNS username or password (NM_DYNUSER=${NM_DYNUSER}) (NM_DYNPASS=${NM_DYNPASS})"
|
echo "Missing DYNDNS username or password (NM_DYNUSER=${NM_DYNUSER}) (NM_DYNPASS=${NM_DYNPASS})"
|
||||||
@@ -529,11 +529,11 @@ UPDATE_DYNDNS(){
|
|||||||
echo
|
echo
|
||||||
echo -en "${idsCL[White]}Previous WAN IP : "
|
echo -en "${idsCL[White]}Previous WAN IP : "
|
||||||
|
|
||||||
if [ "${LOCATION}" == "mainsite" ]; then
|
if [ "${LOCATION,,}" == "mainsite" ]; then
|
||||||
OLDIP=`dig +short sc1.scity.us @wdns.scity.us +time=2`
|
OLDIP=`dig +short sc1.scity.us @wdns.scity.us +time=2`
|
||||||
elif [ "${LOCATION}" == "offsite" ]; then
|
elif [ "${LOCATION,,}" == "offsite" ]; then
|
||||||
OLDIP=`dig +short offsite.scity.us @wdns.scity.us +time=2`
|
OLDIP=`dig +short offsite.scity.us @wdns.scity.us +time=2`
|
||||||
elif [ "${LOCATION}" == "kyle" ]; then
|
elif [ "${LOCATION,,}" == "kyle" ]; then
|
||||||
OLDIP=`dig +short wan.pattonfam.com @wdns.scity.us +time=2`
|
OLDIP=`dig +short wan.pattonfam.com @wdns.scity.us +time=2`
|
||||||
fi
|
fi
|
||||||
echo -e "${idsCL[Cyan]}${OLDIP}"
|
echo -e "${idsCL[Cyan]}${OLDIP}"
|
||||||
@@ -549,9 +549,10 @@ UPDATE_DYNDNS(){
|
|||||||
if [ ${FORCE} -eq 1 ]; then
|
if [ ${FORCE} -eq 1 ]; then
|
||||||
echo -en "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Yellow]}' WAN IP has not changed...\n${idsCL[Green]}but what the heck, lets update the records anyway ehh ... "
|
echo -en "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Yellow]}' WAN IP has not changed...\n${idsCL[Green]}but what the heck, lets update the records anyway ehh ... "
|
||||||
else
|
else
|
||||||
|
SENDNOTICE "${LOCATION^^} WAN IP Changed" "Updated '${LOCATION^}' WAN IP from '${OLDIP}' to '${NEWIP}'"
|
||||||
echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... "
|
echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... "
|
||||||
fi
|
fi
|
||||||
if [ "${LOCATION}" == "mainsite" ]; then
|
if [ "${LOCATION,,}" == "mainsite" ]; then
|
||||||
#external dns
|
#external dns
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
@@ -563,7 +564,7 @@ UPDATE_DYNDNS(){
|
|||||||
#internal dns
|
#internal dns
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
|
|
||||||
elif [ "${LOCATION}" == "offsite" ]; then
|
elif [ "${LOCATION,,}" == "offsite" ]; then
|
||||||
#external dns
|
#external dns
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
@@ -571,11 +572,10 @@ UPDATE_DYNDNS(){
|
|||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
|
|
||||||
elif [ "${LOCATION}" == "kyle" ]; then
|
elif [ "${LOCATION,,}" == "kyle" ]; then
|
||||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=wan.pattonfam.com&myip=${NEWIP}" > /dev/null 2>&1
|
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=wan.pattonfam.com&myip=${NEWIP}" > /dev/null 2>&1
|
||||||
|
|
||||||
fi
|
fi
|
||||||
SENDNOTICE "${LOCATION^^} DYNDNS Updated" "Updated ${LOCATION^} WAN IP from '${OLDIP}' to '${NEWIP}'"
|
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user