Update dsmon.sh

This commit is contained in:
2023-07-15 18:47:09 -05:00
parent 13c16e2e92
commit 8139207f75

View File

@@ -333,11 +333,10 @@ GETTSIP_NODE(){
TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1)
hostname=$(hostname -f); hostname=${hostname,,} hostname=$(hostname -f); hostname=${hostname,,}
([ "${hostname}" == "" ] || [[ "${hostname}" != *".scity"* ]]) && hostname=$(hostname) && hostname="${hostname,,}.ts.scity.us" || hostname=${hostname/.scity/.ts.scity} ([ "${hostname}" == "" ] || [[ "${hostname}" != *".scity"* ]]) && hostname=$(hostname) && hostname="${hostname,,}.ts.scity.us" || hostname=${hostname/.scity/.ts.scity}
echo "${hostname,,}"
echo "Tailscale running, TSIP: ${TSIP}" echo "Tailscale running, TSIP: ${TSIP}"
echo -en "Updating DNS for '${hostname}' ... " echo -en "Updating DNS for '${hostname}' ... "
# /usr/bin/curl "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=backup.ts.scity.us&myip=${TSIP}" >/dev/null 2>&1 dyndns=$(/usr/bin/curl "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=backup.ts.scity.us&myip=${TSIP}")
echo "Done" echo "Done - (${dyndns})"
else else
echo "Not running Tailscale" echo "Not running Tailscale"
fi fi