summaryrefslogtreecommitdiff
path: root/images/router/service/letsencrypt/run
blob: 7fcc76d0a2c96f51dc79f56af1dabe60329bf4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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