2018-04-23 17:55:55 +00:00
|
|
|
#!/bin/bash
|
2017-07-12 01:57:57 +00:00
|
|
|
s6-svc -O /etc/s6.d/dehydrated
|
2017-12-01 16:32:19 +00:00
|
|
|
|
2018-04-23 17:55:55 +00:00
|
|
|
# If config generation is turned on, generate a config from the template and current env vars
|
|
|
|
if [[ "$DEHYDRATED_GENERATE_CONFIG" == "yes" ]]; then
|
|
|
|
j2 /etc/dehydrated/config.j2 > /data/config
|
|
|
|
fi
|
|
|
|
|
2017-12-01 16:32:19 +00:00
|
|
|
# Set ownership to dehydrated on the relevant folders
|
2018-04-23 17:55:55 +00:00
|
|
|
chown -R ${UID}:${GID} /data
|
2017-12-01 16:32:19 +00:00
|
|
|
|
|
|
|
# Register to the CA
|
2018-04-23 17:55:55 +00:00
|
|
|
if [[ "$DEHYDRATED_ACCEPT_TERMS" == "yes" ]]; then
|
|
|
|
su-exec ${UID}:${GID} /opt/dehydrated/dehydrated --config /data/config --register --accept-terms
|
|
|
|
fi
|
2017-12-01 16:32:19 +00:00
|
|
|
|
|
|
|
# Run the weekly script once
|
2017-07-12 01:57:57 +00:00
|
|
|
/etc/periodic/weekly/dehydrated
|