]> git.pld-linux.org Git - packages/dehydrated.git/commitdiff
- more examples in hook
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 1 Aug 2016 10:30:41 +0000 (12:30 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 1 Aug 2016 10:30:41 +0000 (12:30 +0200)
hook.sh

diff --git a/hook.sh b/hook.sh
index d175d83c389dc79d80ffd3fc9bf0d73b8fbc9983..232674d9b4ba1a79f943d2904bb956f7943a6c29 100755 (executable)
--- 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..."
This page took 0.165784 seconds and 4 git commands to generate.