Commit | Line | Data |
---|---|---|
55799f78 MW |
1 | #! /bin/sh |
2 | set -e | |
93005620 | 3 | usage=" TAG" |
55799f78 MW |
4 | . "${0%/*}/../config.sh" |
5 | . "$home/lib/lib.sh" | |
6 | ||
7 | run_as_user "$@" | |
8 | ||
9 | ## Pick out the certificate tag. | |
10 | case $# in 0) fail_usage ;; esac | |
11 | tag=$1; shift | |
12 | case $# in 0) ;; *) fail_usage ;; esac | |
13 | ||
14 | prepare_tmp $tag | |
15 | ||
16 | ## Get started. | |
17 | cd $home/cert/$tag | |
18 | openssl req -in req -out $tmp/req.der -outform der | |
19 | sans=$(openssl req -in req -text -noout | | |
20 | sed -n ' | |
21 | x | |
22 | /^ *X509v3 Subject Alternative Name: $/ { | |
23 | x | |
24 | s/ *DNS://g | |
25 | s/,/ /g | |
26 | p | |
27 | x | |
28 | }') | |
29 | make_le_conf $sans | |
30 | ||
31 | cat "$tmp/le.conf" |