comparison scripts/create-combined-pemfile @ 88:08c6e8c87caa

Certificate post-hook script: add option to restart lighttpd.
author John "Elwin" Edwards
date Fri, 14 Dec 2018 16:24:37 -0500
parents c99fac2b0dc7
children
comparison
equal deleted inserted replaced
87:1bddd1839831 88:08c6e8c87caa
4 4
5 if [ $# -lt 1 ] 5 if [ $# -lt 1 ]
6 then 6 then
7 echo "No domains given." 7 echo "No domains given."
8 exit 1 8 exit 1
9 fi
10
11 if [ "$1" = "-r" ]
12 then
13 RESTART=1
14 shift
15 else
16 RESTART=0
9 fi 17 fi
10 18
11 for DOMAIN in "$@" 19 for DOMAIN in "$@"
12 do 20 do
13 LINKDIR=/etc/letsencrypt/live/"$DOMAIN" 21 LINKDIR=/etc/letsencrypt/live/"$DOMAIN"
22 chown root:root "$PEMFILE" 30 chown root:root "$PEMFILE"
23 chmod 400 "$PEMFILE" 31 chmod 400 "$PEMFILE"
24 cat "$LINKDIR"/privkey.pem "$LINKDIR"/cert.pem >"$PEMFILE" 32 cat "$LINKDIR"/privkey.pem "$LINKDIR"/cert.pem >"$PEMFILE"
25 ln -s -f -r "$PEMFILE" "$LINKDIR"/combined.pem 33 ln -s -f -r "$PEMFILE" "$LINKDIR"/combined.pem
26 done 34 done
35
36 if [ "$RESTART" = 1 ]
37 then
38 systemctl restart lighttpd
39 fi