update
This commit is contained in:
@@ -517,7 +517,7 @@ UPDATE_DYNDNS(){
|
||||
cw_spc=10
|
||||
echo -e "Checking for DYNDNS update at '${idsCL[Green]}${LOCATION^^}${idsCL[Default]}'"
|
||||
echo
|
||||
echo -en "${idsCL[White]}Previous WAN IP : "; OLDIP=`dig +short ${DYNDNS_HOSTS[0]} @wdns.scity.us +time=2`; echo -e "${idsCL[Cyan]}${OLDIP}"
|
||||
echo -en "${idsCL[White]}Previous WAN IP : "; OLDIP=`dig +short ${DYNDNS_HOSTS[0]} @${NM_WANDNS} +time=2`; echo -e "${idsCL[Cyan]}${OLDIP}"
|
||||
echo -en "${idsCL[White]}Current WAN IP : "; NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com +time=2`; echo -e "${idsCL[LightGreen]}${NEWIP}"
|
||||
echo
|
||||
|
||||
@@ -532,12 +532,12 @@ UPDATE_DYNDNS(){
|
||||
echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... "
|
||||
fi
|
||||
if [ "${NM_DYNUSER}" != "" ] && [ "${NM_DYNPASS}" != "" ]; then
|
||||
if [ "$(curl -m 3 -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@wdns.scity.us/domain/${domain}" | grep "HTTP 403 Error")" == "" ]; then
|
||||
if [ "$(curl -m 3 -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@${NM_WANDNS}/domain/${domain}" | grep "HTTP 403 Error")" == "" ]; then
|
||||
for host in ${DYNDNS_HOSTS[@]}; do
|
||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=${host}&myip=${NEWIP}" > /dev/null 2>&1
|
||||
/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@${NM_WANDNS}/nic/update?hostname=${host}&myip=${NEWIP}" > /dev/null 2>&1
|
||||
done
|
||||
[ "${LOCATION,,}" == "mainsite" ] && /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@ldns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||
[ "${LOCATION,,}" == "offsite" ] && /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@ldns.scity.us/nic/update?hostname=wan.offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||
[ "${LOCATION,,}" == "mainsite" ] && /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@${NM_LANDNS}/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||
[ "${LOCATION,,}" == "offsite" ] && /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@${NM_LANDNS}/nic/update?hostname=wan.offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
|
||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||
else
|
||||
echo -e "\n\n${idsCL[LightRed]}INVALID DYNDNS username and/or password (NM_DYNUSER=${NM_DYNUSER}) (NM_DYNPASS=${NM_DYNPASS})\n"
|
||||
@@ -564,7 +564,7 @@ UPDATE_DYNDNS(){
|
||||
fi
|
||||
if [ ${TESTMODE} -eq 1 ]; then
|
||||
echo -en "\nDYNDNS Credential Test: "
|
||||
if [ "$(curl -m 3 -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@wdns.scity.us/domain/${domain}" | grep "HTTP 403 Error")" == "" ]; then
|
||||
if [ "$(curl -m 3 -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@${NM_WANDNS}/domain/${domain}" | grep "HTTP 403 Error")" == "" ]; then
|
||||
echo -e "${idsCL[Green]}Pass${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[LightRed]}Fail${idsCL[Default]}"
|
||||
|
||||
Reference in New Issue
Block a user