comparison scripts/create-combined-pemfile @ 76:c99fac2b0dc7

Add files related to SSL support.
author John "Elwin" Edwards
date Fri, 30 Dec 2016 12:48:58 -0500
parents
children 08c6e8c87caa
comparison
equal deleted inserted replaced
75:d8720dbc16bb 76:c99fac2b0dc7
1 #!/bin/sh
2 # Combines a private key and host cert into a single pemfile, for webservers
3 # that require it.
4
5 if [ $# -lt 1 ]
6 then
7 echo "No domains given."
8 exit 1
9 fi
10
11 for DOMAIN in "$@"
12 do
13 LINKDIR=/etc/letsencrypt/live/"$DOMAIN"
14 if [ ! -d "$LINKDIR" ]
15 then
16 echo "No certificates for $DOMAIN, skipping"
17 continue
18 fi
19 REALCERTFILE=`readlink -f "$LINKDIR"/cert.pem`
20 PEMFILE=`dirname "$REALCERTFILE"`/combined.pem
21 touch "$PEMFILE"
22 chown root:root "$PEMFILE"
23 chmod 400 "$PEMFILE"
24 cat "$LINKDIR"/privkey.pem "$LINKDIR"/cert.pem >"$PEMFILE"
25 ln -s -f -r "$PEMFILE" "$LINKDIR"/combined.pem
26 done