summary refs log tree commit diff stats
path: root/add_https.sh
blob: 0664796e9326370d713e788b6b33e9ddd78cd22a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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