summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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