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,20 @@
1
+#!/bin/sh
2
+set -euC
3
+
4
+# This is a naive guess. A better implementation would use e.g. the Public
5
+# Suffix List.
6
+re='\(\(.*\)\.\)\?\([^.]\+\.[^.]\+\)'
7
+domain="$(echo "$CERTBOT_DOMAIN" | sed -n "s/$re/\3/p")"
8
+name="$(echo "$CERTBOT_DOMAIN" | sed -n "s/$re/\2/p")"
9
+
10
+name="_acme-challenge${name:+".$name"}"
11
+data="$CERTBOT_VALIDATION"
12
+
13
+dir="$(cd "$(dirname "$0")" ; pwd)"
14
+
15
+"$dir/nfsn-send" "POST" "/dns/$domain/addRR" \
16
+    "name" "$name" \
17
+    "type" "TXT" \
18
+    "data" "$data"
19
+
20
+sleep "${NFSN_DNS_CERTBOT_AUTH_SLEEP:-"30"}"