]> git.pld-linux.org Git - packages/dehydrated.git/blob - hook.sh
lighttpd: keep privkey as last
[packages/dehydrated.git] / hook.sh
1 #!/bin/sh
2
3 case "$1" in
4 deploy_cert)
5         DOMAIN="$2"
6         PRIVKEY="$3"
7         CERT="$4"
8         FULLCHAINCERT="$5"
9         CHAINCERT="$6"
10         TIMESTAMP="$7"
11         if [ -x /usr/sbin/lighttpd -a -f /etc/lighttpd/server.pem ]; then
12                 echo " + Hook: Overwritting /etc/lighttpd/server.pem and reloading lighttpd..."
13                 cat "/etc/webapps/letsencrypt.sh/certs/${DOMAIN}/{fullchain,privkey}.pem" > /etc/lighttpd/server.pem
14                 /sbin/service lighttpd reload
15         fi
16         if [ -f /etc/nginx/server.pem -a -f /etc/nginx/server.key ]; then
17                 nginx="nginx-standard"
18                 [ -x /etc/rc.d/init.d/nginx-light ] && nginx="nginx-light"
19                 echo " + Hook: Overwritting /etc/nginx/server.{pem,key} and reloading nginx..."
20                 cat "/etc/webapps/letsencrypt.sh/certs/${DOMAIN}/fullchain.pem" > /etc/nginx/server.pem
21                 cat "/etc/webapps/letsencrypt.sh/certs/${DOMAIN}/privkey.pem" > /etc/nginx/server.key
22                 /sbin/service "$nginx" reload
23         fi
24         if [ -x /etc/rc.d/init.d/httpd ]; then
25                 echo " + Hook: Reloading Apache..."
26                 /sbin/service httpd graceful
27         fi
28         ;;
29 clean_challenge)
30         CHALLENGE_TOKEN="$2"
31         KEYAUTH="$3"
32         echo " + Hook: $1: Nothing to do..."
33         ;;
34 deploy_challenge)
35         echo " + Hook: $1: Nothing to do..."
36         ;;
37 unchanged_cert)
38         echo " + Hook: $1: Nothing to do..."
39         ;;
40 *)
41         echo " + Hook: $1: Nothing to do..."
42         ;;
43 esac
This page took 0.079866 seconds and 4 git commands to generate.