blob: 1040144f2940663174f3356d4bd0fb6fb25aba16 (
plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/bin/sh
set -eu
opts()
{
cat "$1" | while read domain alias
do
printf "%s" "-w /srv/letsencrypt/$domain -d $domain"
if [ -n "$alias" ]
then
printf "%s" " -d $alias"
fi
printf "\n"
done
}
run_certbot()
{
local list="$1"
local certname="$2"
certbot certonly \
--standalone \
--noninteractive \
--email "{{ letsencrypt_email }}" \
--agree-tos \
--expand \
--cert-name "$certname" \
$(opts "$list")
}
systemctl stop apache2 || true
for list in /etc/letsencrypt/*.list
do
certname="$(basename "$list" .list)"
run_certbot "$list" "$certname" || true
done
systemctl start apache2 || true
|