From 517370e92d853167bb8254e12c8b814d8c3e78a1 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Nov 2023 16:59:59 -0600 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index 9a967f8..8f46593 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -359,9 +359,11 @@ GETTSIP_NODE(){ hostname=$(hostname -f); hostname=${hostname,,} ([ "${hostname}" == "" ] || [[ "${hostname}" != *".scity"* ]]) && hostname=$(hostname) && hostname="${hostname,,}.ts.scity.us" || hostname=${hostname/.scity/.ts.scity} echo "Tailscale running, TSIP: ${TSIP}" - echo -en "Updating DNS for '${hostname}' ... " - dyndns=$(/usr/bin/curl -s "https://systems:Dcs9613@ldns.scity.us/nic/update?hostname=${hostname}&myip=${TSIP}") - echo "Done (${dyndns})" + if [ "${NM_PDNS_USER}" != "" ]; then + echo -en "Updating DNS for '${hostname}' ... " + dyndns=$(/usr/bin/curl -s "https://${NM_PDNS_USER}:${NM_PDNS_PASS}@ldns.scity.us/nic/update?hostname=${hostname}&myip=${TSIP}") + echo "Done (${dyndns})" + fi else echo "Not running Tailscale" fi