From ec17c0f71bda52eea68ede4c8715dd65763ec571 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 15 Jul 2023 18:17:08 -0500 Subject: [PATCH] update --- defaults.inc | 4 ++-- nodemgmt-scripts.sh | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/defaults.inc b/defaults.inc index 954d34cd..a399cf55 100755 --- a/defaults.inc +++ b/defaults.inc @@ -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="" diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 2fc4e3eb..30460abe 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -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}'"