implemented cron mode

This commit is contained in:
2021-10-27 11:14:09 +02:00
parent 2ad37e8fe3
commit bcd5130866
3 changed files with 33 additions and 3 deletions

14
init.sh
View File

@@ -148,6 +148,20 @@ if [[ $RUN_SHELL == true ]]; then
exit 0
fi
# If cron mode, run cron tasks then exit
if [[ $CRON_MODE == true ]]; then
for mod in $MODULE_LIST; do
if [[ $(function_exists cron_$mod) ]]; then
prnt I "Running cron task for module $mod ..."
cron_$mod
else
prnt I "No cron task for module $mod."
fi
done
prnt I "All cron executed successfully !"
exit 0
fi
# Run prechecks
if [[ JUMP != true ]]; then
tmpfile=$(mktemp /tmp/init-XXXXXX)