]> git.pld-linux.org Git - packages/dehydrated.git/blame - hook.sh
Use provided variables.
[packages/dehydrated.git] / hook.sh
CommitLineData
5765eca7
ER
1#!/bin/sh
2
3case "$1" in
4deploy_cert)
62eb8e9f
AM
5 DOMAIN="$2"
6 PRIVKEY="$3"
7 CERT="$4"
8 FULLCHAINCERT="$5"
9 CHAINCERT="$6"
10 TIMESTAMP="$7"
ea05e75e
ER
11 if [ -x /usr/sbin/lighttpd -a -f /etc/lighttpd/server.pem ]; then
12 echo " + Hook: Overwritting /etc/lighttpd/server.pem and reloading lighttpd..."
f06d75cc 13 cat "$FULLCHAINCERT" "$PRIVKEY" > /etc/lighttpd/server.pem
62eb8e9f
AM
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..."
f06d75cc
AM
20 cat "$FULLCHAINCERT" > /etc/nginx/server.pem
21 cat "$PRIVKEY" > /etc/nginx/server.key
62eb8e9f
AM
22 /sbin/service "$nginx" reload
23 fi
24 if [ -x /etc/rc.d/init.d/httpd ]; then
ea05e75e 25 echo " + Hook: Reloading Apache..."
62eb8e9f
AM
26 /sbin/service httpd graceful
27 fi
28 ;;
29clean_challenge)
30 CHALLENGE_TOKEN="$2"
31 KEYAUTH="$3"
32 echo " + Hook: $1: Nothing to do..."
33 ;;
34deploy_challenge)
35 echo " + Hook: $1: Nothing to do..."
36 ;;
37unchanged_cert)
38 echo " + Hook: $1: Nothing to do..."
5765eca7
ER
39 ;;
40*)
41 echo " + Hook: $1: Nothing to do..."
42 ;;
43esac
This page took 0.068004 seconds and 4 git commands to generate.