2 # based on https://github.com/lukas2511/dehydrated/wiki/example-dns-01-nsupdate-script
6 # concat file atomic way
12 cp -f $file $file.dehydrated~
17 if [ ! -x /usr/sbin/lighttpd ] || [ ! -f /etc/lighttpd/server.pem ]; then
21 echo " + Hook: Overwritting /etc/lighttpd/server.pem and reloading lighttpd..."
22 atomic_concat /etc/lighttpd/server.pem "$FULLCHAINCERT" "$PRIVKEY"
23 /sbin/service lighttpd reload
27 if [ ! -x /usr/sbin/haproxy ] || [ ! -f /etc/haproxy/server.pem ]; then
31 echo " + Hook: Overwritting /etc/haproxy/server.pem and restarting haproxy..."
32 atomic_concat /etc/haproxy/server.pem "$FULLCHAINCERT" "$PRIVKEY"
33 /sbin/service haproxy reload
37 if [ ! -f /etc/nginx/server.crt ] || [ ! -f /etc/nginx/server.key ]; then
41 echo " + Hook: Overwritting /etc/nginx/server.{crt,key} and reloading nginx..."
42 atomic_concat /etc/nginx/server.crt "$FULLCHAINCERT"
43 atomic_concat /etc/nginx/server.key "$PRIVKEY"
44 /sbin/service nginx reload
48 if [ ! -x /etc/rc.d/init.d/httpd ]; then
52 echo " + Hook: Reloading Apache..."
53 /sbin/service httpd graceful
59 echo "Add the following to the zone definition of ${2}:"
60 echo "'_acme-challenge.${2}:${4}:300"
62 echo -n "Press enter to continue..."
68 echo "Now you can remove the following from the zone definition of ${2}:"
69 echo "'_acme-challenge.${2}:${4}:300"
71 echo -n "Press enter to continue..."
92 echo "Unknown hook \"${1}\""