summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2022-04-02 12:26:41 -0700
committerJesse Morgan <jesse@jesterpm.net>2022-04-02 12:26:41 -0700
commit5c83b20b52f60d105a0979d7760df49d04d9e6f5 (patch)
tree8408e08437146f27bdf99b8526fb23e385e78473
parentb618211b21c2d89910b031ccdc4637f5dd1b3ae9 (diff)
update-dyndns: skip ULA addresses
-rwxr-xr-xupdate-dyndns4
1 files changed, 2 insertions, 2 deletions
diff --git a/update-dyndns b/update-dyndns
index 5ac19e0..0679843 100755
--- a/update-dyndns
+++ b/update-dyndns
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
##
## Update a Route53 record with this host's IP addresses.
@@ -25,7 +25,7 @@ RECORDSET=$(hostname --fqdn)
COMMENT="Auto updating @ `date`"
IP4=$(dig +short myip.opendns.com @resolver1.opendns.com)
-IP6=$((ip -6 addr list|grep inet6|grep global|grep -v temporary|awk '{print $2}'; ip -6 addr list|grep inet6|grep global|grep temporary|awk -F '{print $2}')|head -n1|cut -d/ -f1)
+IP6=$((ip -6 addr list|grep inet6|grep global|grep -v temporary|awk '{print $2}'; ip -6 addr list|grep inet6|grep global|grep temporary|awk '{print $2}')|grep -v '^fd00:'|head -n1|cut -d/ -f1)
function valid_ip4()
{