summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok cheetah2023-08-25 20:18:16 +0200
committeruvok cheetah2023-08-25 20:18:16 +0200
commit27a9fc8e3d54ca9cc1f3e9290549f322df68e43f (patch)
tree7d1d24bff826f8b02be360f310c974b3a4542f2a
parent35119230a239042cd20deb41e5f13e07f8a4ea40 (diff)
Add ejabberd certificate replacement
-rw-r--r--other_scripts/ejabberd_cert.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/other_scripts/ejabberd_cert.sh b/other_scripts/ejabberd_cert.sh
new file mode 100644
index 0000000..4400a97
--- /dev/null
+++ b/other_scripts/ejabberd_cert.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# adjust to your needs
+certdir="/etc/letsencrypt/live/xmpp.uvok.de/"
+
+if [[ -n "$RENEWED_LINEAGE" ]]; then
+ certdir="$RENEWED_LINEAGE"
+fi
+
+echo "Deploying Ejabberd cert for $certdir"
+
+# not sure if reload suffices, better be safe than sorry
+systemctl stop ejabberd
+
+# adjust paths to your needs
+cp -v "$certdir/fullchain.pem" "/var/lib/ejabberd/certs/fullchain.pem"
+cp -v "$certdir/privkey.pem" "/var/lib/ejabberd/certs/key.pem"
+chown -v ejabberd: /var/lib/ejabberd/certs/fullchain.pem /var/lib/ejabberd/certs/key.pem
+
+systemctl start ejabberd