This commit is contained in:
2023-07-15 18:17:08 -05:00
parent 3ab6850a07
commit ec17c0f71b
2 changed files with 4 additions and 7 deletions

View File

@@ -108,9 +108,9 @@ if [ -f ${NM_FOLDER}/defaults.local.inc ]; then
fi
TSI=$(/sbin/ip link | grep tailscale0)
[ ${#TSI} != 0 ] && RUN_NODE_TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) || RUN_NODE_TSIP=
TSI=$(/sbin/ip link | grep tailscale0) && [ ${#TSI} != 0 ] && RUN_NODE_TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) || RUN_NODE_TSIP=
RNIP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)
for NTYPE in "${NM_NODE_TYPES[@]}"; do
var=${NTYPE}_HOSTS[@]
RUN_NODE_TYPE=""

View File

@@ -534,11 +534,8 @@ 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=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
L_OLDIP=`dig +short offsite.scity.us @10.10.10.5 +time=2`
if ([ "${L_OLDIP}" != "" ] && [[ "${L_OLDIP}" != *";"* ]] && [ "${L_OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then
/usr/bin/curl -s "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
/usr/bin/curl -s "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
fi
/usr/bin/curl -s "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1
/usr/bin/curl -s "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1
fi
SENDNOTICE "${1^^} DYNDNS Updated" "Updated ${1^} WAN IP from '${OLDIP}' to '${NEWIP}'"