-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add letsencrypt-ejabberd-post-renewal-hook
- Loading branch information
Nicolas North
committed
Jun 3, 2018
1 parent
2abd45b
commit 14da108
Showing
2 changed files
with
69 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
|
||
echo "Now creating all-in-one TLS files for all LetsEncrypt provisioned certs for ejabberd..." | ||
echo | ||
|
||
#chgrp -R ssl-cert /etc/letsencrypt | ||
#chmod -R g=rX /etc/letsencrypt | ||
#chmod 750 /etc/letsencrypt/live/ | ||
#chmod 750 /etc/letsencrypt/archive/ | ||
|
||
le_dir=/etc/letsencrypt/live | ||
tls_dir=/etc/ssl/aenigma | ||
|
||
for le_cert_domain_full in "$le_dir"/* | ||
do | ||
|
||
le_cert_domain="$(echo $le_cert_domain_full | sed 's:.*/::')" | ||
|
||
echo "Now creating all-in-one TLS file for $le_cert_domain for ejabberd..." | ||
echo | ||
|
||
touch "$tls_dir/$le_cert_domain.pem" | ||
cat "$le_dir/$le_cert_domain/privkey.pem" > "$tls_dir/$le_cert_domain.pem" | ||
cat "$le_dir/$le_cert_domain/fullchain.pem" >> "$tls_dir/$le_cert_domain.pem" | ||
|
||
echo "Finished creating all-in-one TLS file for $le_cert_domain for ejabberd." | ||
echo | ||
|
||
done | ||
|
||
chown -R ejabberd:ejabberd $tls_dir | ||
chmod -R 700 $tls_dir | ||
|
||
echo "Finished creating all-in-one TLS files." | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters