implemented cron mode
This commit is contained in:
14
init.sh
14
init.sh
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user