icinga2-container/usr/bin/update-certs

29 lines
711 B
Plaintext
Raw Permalink Normal View History

2016-04-29 19:07:22 +00:00
#!/bin/sh
set -eux
gen_cert() {
local app="$1"; shift
local restart_action="$1"; shift
cd "/etc/ssl/letsencrypt/$app"
mkdir -p "/etc/ssl/letsencrypt/$app"
set +e
simp_le --email joerg@higgsboson.tk \
-f account_key.json \
-f fullchain.pem \
-f key.pem \
$(for domain in "$@"; do echo "-d $domain"; done) \
--default_root /var/www/letsenrypt
local rc=$?
[ $rc = 1 ] && $restart_action
[ $rc != 0 ] && exit $rc
2016-04-30 23:20:43 +00:00
set -e
cat fullchain.pem key.pem > combined.pem
2016-04-29 19:07:22 +00:00
}
gen_cert "nginx" "nginx -s reload" "status.higgsboson.tk" "stats.higgsboson.tk"
gen_cert "influxdb" "s6-svc -t /var/run/s6/services/influxdb" "influxdb.higgsboson.tk"
touch /etc/ssl/letsencrypt/last-check