-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
23 lines (19 loc) · 967 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Stops the script, if an error occurred.
set -e
touch rm -f /etc/cron.d/crontab \
&& touch /etc/cron.d/crontab \
&& echo DIGITALOCEAN_TOKEN=$DIGITALOCEAN_TOKEN >> /etc/cron.d/crontab \
&& echo DIGITALOCEAN_CDN_ORIGIN=$DIGITALOCEAN_CDN_ORIGIN >> /etc/cron.d/crontab \
&& echo DOMAIN_NAME=$DOMAIN_NAME >> /etc/cron.d/crontab \
&& echo LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL >> /etc/cron.d/crontab \
&& echo CLOUDFLARE_API_KEY=$CLOUDFLARE_API_KEY >> /etc/cron.d/crontab \
&& echo CLOUDFLARE_EMAIL=$CLOUDFLARE_EMAIL >> /etc/cron.d/crontab \
&& if [ -n "${SPACES}" ]; then echo SPACES=$SPACES >> /etc/cron.d/crontab; fi \
&& if [ -n "${CERTBOT_ARGS}" ]; then echo CERTBOT_ARGS=$CERTBOT_ARGS >> /etc/cron.d/crontab; fi \
&& cat /tmp/crontab >> /etc/cron.d/crontab \
&& cat /etc/cron.d/crontab
chown -R root /etc/cron.d/crontab \
&& chmod 0644 /etc/cron.d/crontab \
&& crontab /etc/cron.d/crontab
exec "$@"