2019-11-11 23:18:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2021-07-30 15:39:47 +00:00
|
|
|
if [ "$(ls -A /usr/local/share/ca-certificates/)" ]; then
|
|
|
|
|
update-ca-certificates
|
|
|
|
|
fi
|
|
|
|
|
|
2019-11-11 23:18:59 +00:00
|
|
|
# Prior art:
|
2022-04-26 15:11:07 +00:00
|
|
|
# - https://github.com/renskiy/cron-docker-image/blob/5600db37acf841c6d7a8b4f3866741bada5b4622/debian/start-cron#L34-L36
|
2019-11-11 23:18:59 +00:00
|
|
|
# - https://blog.knoldus.com/running-a-cron-job-in-docker-container/
|
|
|
|
|
|
2022-10-21 20:46:35 +00:00
|
|
|
declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' >/container.env
|
2019-11-11 23:18:59 +00:00
|
|
|
|
|
|
|
|
{ for cron_job in "$@"; do echo -e "SHELL=/bin/bash
|
|
|
|
|
BASH_ENV=/container.env
|
2022-10-21 20:46:35 +00:00
|
|
|
${cron_job} > /proc/1/fd/1 2>/proc/1/fd/2"; done; } |
|
|
|
|
|
sed --regexp-extended 's/\\(.)/\1/g' |
|
|
|
|
|
crontab -
|
2019-11-11 23:18:59 +00:00
|
|
|
crontab -l
|
|
|
|
|
exec cron -f -l -L 15
|