Browse code

WIP: Add implementation

Robert Cranston authored on 17/06/2023 18:12:27
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,23 @@
1
+#!/bin/sh
2
+set -euC
3
+
4
+# nfsn-dns-dkim DOMAIN NAME SELECTOR KEY_TYPE KEY_PUB
5
+
6
+# nfsn-dns-dkim "example.com" "" "k1" "rsa" "$key_pub"
7
+
8
+# Arguments.
9
+
10
+domain="$1" ; shift
11
+name="$1" ; shift
12
+selector="$1" ; shift
13
+key_type="$1" ; shift
14
+key_pub="$1" ; shift
15
+
16
+# Process.
17
+
18
+name="$selector._domainkey${name:+".$name"}"
19
+data="v=DKIM1; k=$key_type; p=$key_pub"
20
+
21
+# Update.
22
+
23
+nfsn-dns-update "$domain" "$name" "TXT" '^v=DKIM1' "$data"