aboutsummaryrefslogtreecommitdiffstats
path: root/example-hook.sh
blob: 48eb07b0f267980b6ec54eebbd8a362d9c5913b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /bin/sh
# This source code is released into the public domain.
#
# An example hook.

# Action is always 'newcert', at least for now.
action="$1"

# Environment variables:
# $LFACME_CERT is the name of the certificate
# $LFACME_CERTFILE is the filename of the certificate.
# $LFACME_KEYFILE is the filename of the private key.

set -e

case "$action" in
newcert)
	# The certificate was issued or renewed.
	cp "$LFACME_CERTFILE" /usr/local/etc/nginx/tls/cert.pem
	cp "$LFACME_KEYFILE" /usr/local/etc/nginx/tls/key.pem
	nginx -s reload
	;;

*)
	# Ignore unknown actions, because new ones might be added later.
	;;
esac