[packages/letsencrypt.sh] - more examples in hook
arekm
arekm at pld-linux.org
Mon Aug 1 12:30:48 CEST 2016
commit 62eb8e9f624f8e89bf21a25c59efcb02981dea75
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Aug 1 12:30:41 2016 +0200
- more examples in hook
hook.sh | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/hook.sh b/hook.sh
index d175d83..232674d 100755
--- a/hook.sh
+++ b/hook.sh
@@ -2,8 +2,40 @@
case "$1" in
deploy_cert)
- echo " + Hook: Restarting Webserver..."
- /sbin/service lighttpd reload
+ DOMAIN="$2"
+ PRIVKEY="$3"
+ CERT="$4"
+ FULLCHAINCERT="$5"
+ CHAINCERT="$6"
+ TIMESTAMP="$7"
+ if [ -x /usr/sbin/lighttpd -a -f /etc/lighttpd/ligcert.pem ]; then
+ echo " + Hook: Overwritting /etc/lighttpd/ligcert.pem and reloading lighttpd..."
+ cat "/etc/webapps/letsencrypt.sh/certs/${DOMAIN}/{privkey,fullchain}.pem" > /etc/lighttpd/ligcert.pem
+ /sbin/service lighttpd reload
+ fi
+ if [ -f /etc/nginx/server.pem -a -f /etc/nginx/server.key ]; then
+ nginx="nginx-standard"
+ [ -x /etc/rc.d/init.d/nginx-light ] && nginx="nginx-light"
+ echo " + Hook: Overwritting /etc/nginx/server.{pem,key} and reloading nginx..."
+ cat "/etc/webapps/letsencrypt.sh/certs/${DOMAIN}/fullchain.pem" > /etc/nginx/server.pem
+ cat "/etc/webapps/letsencrypt.sh/certs/${DOMAIN}/privkey.pem" > /etc/nginx/server.key
+ /sbin/service "$nginx" reload
+ fi
+ if [ -x /etc/rc.d/init.d/httpd ]; then
+ echo " + Hook: Reloading apache..."
+ /sbin/service httpd graceful
+ fi
+ ;;
+clean_challenge)
+ CHALLENGE_TOKEN="$2"
+ KEYAUTH="$3"
+ echo " + Hook: $1: Nothing to do..."
+ ;;
+deploy_challenge)
+ echo " + Hook: $1: Nothing to do..."
+ ;;
+unchanged_cert)
+ echo " + Hook: $1: Nothing to do..."
;;
*)
echo " + Hook: $1: Nothing to do..."
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/letsencrypt.sh.git/commitdiff/62eb8e9f624f8e89bf21a25c59efcb02981dea75
More information about the pld-cvs-commit
mailing list