summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorKjetil Ørbekk <kj@orbekk.com>2020-11-08 18:23:56 -0500
committerKjetil Ørbekk <kj@orbekk.com>2020-11-08 18:24:30 -0500
commit605a2005bb92dc47556ea6e540d4d2d1c515ffdc (patch)
treed59a12381014b59baf0e12588b8364db657c4db7 /tools
parentd37a4f11e1ff414f2e9fccf4316a99d914934279 (diff)
dragon config
Diffstat (limited to 'tools')
-rwxr-xr-xtools/update-dns.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/update-dns.sh b/tools/update-dns.sh
index bce4de4..4c0160c 100755
--- a/tools/update-dns.sh
+++ b/tools/update-dns.sh
@@ -1,5 +1,3 @@
-#!/usr/bin/env bash
-
keyfile=/opt/secret/bind/dynamic.orbekk.com/update/named.conf.key
update() {
@@ -12,7 +10,7 @@ update() {
echo "Update $host to $ip ($type)"
{
- echo server dragon.orbekk.com
+ echo server 2001:470:8e2e:20::d
echo update delete ${host}. ${type}
echo update add ${host}. 300 ${type} ${ip}
echo send
@@ -20,4 +18,11 @@ update() {
}
ip_4="$(ip -br -4 addr list dev eno1 | awk -F' *|/' '{print $3}')"
-update A $(hostname).dynamic.orbekk.com $ip_4
+if [[ -n "$ip_4" ]]; then
+ update A $(hostname).dynamic.orbekk.com $ip_4
+fi
+# IPv6 currently broken on Spectrum :(
+# ip_6="$(ip -br -6 addr list scope global dev eno1 | awk -F' *|/' '{print $3}')"
+# if [[ -n "$ip_6" ]]; then
+# update AAAA $(hostname).dynamic.orbekk.com $ip_6
+# fi