diff options
author | System administrator | 2017-05-29 13:26:10 +0200 |
---|---|---|
committer | System administrator | 2017-05-29 13:26:10 +0200 |
commit | bc5c44dd049bad3b007be48b3f8d90886d63c105 (patch) | |
tree | a381d989db2295f228f9bc95a774f0cc9aef4c40 /images/router/service/letsencrypt/run | |
download | server-bc5c44dd049bad3b007be48b3f8d90886d63c105.tar.gz server-bc5c44dd049bad3b007be48b3f8d90886d63c105.tar.xz server-bc5c44dd049bad3b007be48b3f8d90886d63c105.zip |
Initial commit
Diffstat (limited to 'images/router/service/letsencrypt/run')
-rw-r--r-- | images/router/service/letsencrypt/run | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/images/router/service/letsencrypt/run b/images/router/service/letsencrypt/run new file mode 100644 index 0000000..7fcc76d --- /dev/null +++ b/images/router/service/letsencrypt/run @@ -0,0 +1,19 @@ +#!/bin/sh + +# wait for nginx to startup, for http challenge +sv start nginx || exit 1 +sleep 10 + +# half a day, 60 * 60 * 12 +INTERVAL=43200 + +mkdir -p /data/wellknown/acme-challenge + +/app/dehydrated/dehydrated --register --accept-terms --config /app/letsencrypt/config + +while true; do + echo "Updating certificates" + /app/dehydrated/dehydrated --cron --config /app/letsencrypt/config + nginx -s reload # certificates might have changed + sleep $INTERVAL +done |