add ONE_SHOT so container exits after run
This commit is contained in:
@ -761,9 +761,19 @@ then
|
||||
openssl dhparam -out /config/letsencrypt/keys/ssl-dhparams.pem 4096
|
||||
fi
|
||||
|
||||
echo "$INTERVAL /certbot-renew.sh >> /config/logs/renew.log" > /config/.crontab.txt
|
||||
if [ $ONE_SHOT == "true" ]; then
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
|
||||
echo "Starting automatic renewal job. Schedule is $INTERVAL"
|
||||
crontab /config/.crontab.txt
|
||||
echo "ONE_SHOT is true - exiting container"
|
||||
|
||||
elif [ $ONE_SHOT == "false" ]; then
|
||||
|
||||
echo "$INTERVAL /certbot-renew.sh >> /config/logs/renew.log" > /config/.crontab.txt
|
||||
|
||||
echo ""
|
||||
|
||||
echo "Starting automatic renewal job. Schedule is $INTERVAL"
|
||||
crontab /config/.crontab.txt
|
||||
|
||||
fi
|
9
root/check-one-shot.sh
Normal file
9
root/check-one-shot.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
if [ $ONE_SHOT == "true" ]; then
|
||||
|
||||
# Cleanly kill container by sending kill signal to supervisor process
|
||||
kill 1
|
||||
|
||||
fi
|
@ -28,6 +28,7 @@ echo \
|
||||
"PUID=${PUID}
|
||||
PGID=${PGID}
|
||||
TZ=${TZ}
|
||||
ONE_SHOT=${ONE_SHOT}
|
||||
INTERVAL=${INTERVAL}
|
||||
GENERATE_DHPARAM=${GENERATE_DHPARAM}
|
||||
CERT_COUNT=${CERT_COUNT}"
|
||||
|
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/type
Normal file
@ -0,0 +1 @@
|
||||
oneshot
|
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/up
Normal file
1
root/etc/s6-overlay/s6-rc.d/check-one-shot/up
Normal file
@ -0,0 +1 @@
|
||||
exec /check-one-shot.sh
|
Reference in New Issue
Block a user