summaryrefslogtreecommitdiff
path: root/nsupdate.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-13 07:49:13 -0500
committerJeff Carr <[email protected]>2023-04-13 07:49:13 -0500
commit5d7004ad924c602234e67767b285a68fe9a9145f (patch)
treef578376f0165809fed84c3b11b6b4b29864d92c5 /nsupdate.go
parent9975aefe1e4d2a8828185f75344f0e776ecdeaeb (diff)
getting close to nsupdate
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'nsupdate.go')
-rw-r--r--nsupdate.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/nsupdate.go b/nsupdate.go
new file mode 100644
index 0000000..af873a2
--- /dev/null
+++ b/nsupdate.go
@@ -0,0 +1,33 @@
+// inspired from:
+// https://github.com/mactsouk/opensource.com.git
+// and
+// https://coderwall.com/p/wohavg/creating-a-simple-tcp-server-in-go
+
+package main
+
+import (
+ "os"
+)
+
+// ./go-nsupdate \
+// --tsig-algorithm=hmac-sha512 \
+// --tsig-secret="OWh5/ZHIyaz7B8J9m9ZDqZ8448Pke0PTpkYbZmFcOf5a6rEzgmcwrG91u1BHi1/4us+mKKEobDPLw1x6sD+ZJw==" \
+// -i eno2 farm001.lab.wit.org
+
+func nsupdate() {
+ var tsigSecret string
+ log(true, "nsupdate() START")
+ cmd := "go-nsupdate --tsig-algorithm=hmac-sha512"
+ tsigSecret = os.Getenv("TIG_SECRET")
+ cmd += " --tig-secret=\"" + tsigSecret + "\""
+ cmd += " -i wlo1 " + me.hostname
+ log(true, "nsupdate() RUN:", cmd)
+
+ for s, t := range me.ipmap {
+ if (t.IsReal()) {
+ if (t.ipv6) {
+ log(true, "nsupdate() found real AAAA =", s, "on iface", t.iface.Name)
+ }
+ }
+ }
+}