summary refs log tree commit diff stats
path: root/add_https.sh
diff options
context:
space:
mode:
authorAlan Pearce2024-06-22 17:07:31 +0200
committerAlan Pearce2024-06-22 18:02:38 +0200
commit2636c90a5ed7b970469dd31a9be68a683219d79b (patch)
tree026b9b47369df4cc1e2f48250c0ab61e9bc0a3d2 /add_https.sh
downloaddns-2636c90a5ed7b970469dd31a9be68a683219d79b.tar.lz
dns-2636c90a5ed7b970469dd31a9be68a683219d79b.tar.zst
dns-2636c90a5ed7b970469dd31a9be68a683219d79b.zip
Initial commit
Diffstat (limited to 'add_https.sh')
-rwxr-xr-xadd_https.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/add_https.sh b/add_https.sh
new file mode 100755
index 0000000..0664796
--- /dev/null
+++ b/add_https.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+for dom in alanpearce.{eu,uk} aln.pe; do
+  xh PATCH $POWERDNS_API_URL/api/v1/servers/localhost/zones/${dom}. \
+    X-API-KEY:$POWERDNS_API_KEY <<JSON
+{
+  "rrsets": [
+    {
+      "name": "${dom}.",
+      "type": "HTTPS",
+      "ttl": 86400,
+      "changetype": "REPLACE",
+      "records": [
+        {
+          "content": "1 . alpn=h2"
+        }
+      ]
+    },
+    {
+      "name": "www.${dom}.",
+      "type": "HTTPS",
+      "ttl": 86400,
+      "changetype": "REPLACE",
+      "records": [
+        {
+          "content": "1 . alpn=h2"
+        }
+      ]
+    }
+  ]
+}
+JSON
+
+done