summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdkim/update22
1 files changed, 22 insertions, 0 deletions
diff --git a/dkim/update b/dkim/update
new file mode 100755
index 0000000..9459d55
--- /dev/null
+++ b/dkim/update
@@ -0,0 +1,22 @@
+#!/bin/rc -ex
+
+# This script combines other scripts in this directory to automatically
+# generate keypairs and reconfigure relevant servers to use them
+
+selector = `{date +%Y%m%d}
+dkimfiles = `{dkim/mkcert $selector}
+rsapriv = $dkimfiles(1)
+rsatxt = $dkimfiles(2)
+edpriv = $dkimfiles(3)
+edtxt = $dkimfiles(4)
+domain = $1
+zonefile = $2
+
+if (test $#* -gt 2) {
+ echo 'usage: dkim/update [domain] [zonefile]' >[1=2]
+ exit 2
+}
+
+dkim/reconfig-smtpd $rsapriv $edpriv $domain
+dkim/reconfig-dns $rsatxt $edtxt $selector $domain $zonefile
+dkim/purge