sunders/data_handler/utils/entrypoint.sh
Copilot 5ce403cec2
All checks were successful
Build (and tag) Images / Build data_handler Image (push) Successful in 39s
Build (and tag) Images / Build web Image (push) Successful in 55s
fix: Send data handler output to container logs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-15 14:28:07 +01:00

38 lines
No EOL
1.4 KiB
Shell
Executable file

#!/bin/sh
set -e
printf 'ok\n' > /run/update_camera.status
####################################################################################################
### Crontab settings
####################################################################################################
cat<<EOF | dcrontab -
# min hour day month weekday command
*/15 * * * * sh /opt/run_update_camera.sh
EOF
####################################################################################################
### Run prescripts
####################################################################################################
php /opt/init_db.php
#TODO add db_migrations
echo "Prescripts done"
####################################################################################################
### Run script once immediately
####################################################################################################
echo "Running update once initially..."
sh /opt/run_update_camera.sh
echo "Initial update done"
####################################################################################################
### Run cron to schedule periodic task
####################################################################################################
# see: https://github.com/dubiousjim/dcron/issues/13
# ignore using `exec` for `dcron` to get another pid instead of `1`
# exec "$@"
"$@"