diff options
Diffstat (limited to 'mkosibuild-cron')
-rwxr-xr-x | mkosibuild-cron | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/mkosibuild-cron b/mkosibuild-cron index 41179e2..7678e6e 100755 --- a/mkosibuild-cron +++ b/mkosibuild-cron @@ -24,7 +24,25 @@ export CRONSUFFIX MACHINES=() # Import config to override above config -[[ -r /etc/mkosibuild ]] && . /etc/mkosibuild +if [[ -r /etc/mkosibuild ]]; then + . /etc/mkosibuild + crondir="$(echo "$0" | awk -F'/' '{print $3}')" + if [[ "${crondir}" == "cron.hourly" ]] && [[ -n "${HOURLY_MACHINES+x}" ]]; then + MACHINES=("${HOURLY_MACHINES[*]}") + elif [[ "${crondir}" == "cron.daily" ]] && [[ -n "${DAILY_MACHINES+x}" ]]; then + MACHINES=("${DAILY_MACHINES[*]}") + elif [[ "${crondir}" == "cron.weekly" ]] && [[ -n "${WEEKLY_MACHINES+x}" ]]; then + MACHINES=("${WEEKLY_MACHINES[*]}") + elif [[ "${crondir}" == "cron.monthly" ]] && [[ -n "${MONTHLY_MACHINES+x}" ]]; then + MACHINES=("${MONTHLY_MACHINES[*]}") + fi +fi + + +for machine in ${MACHINES[*]}; do + echo "${machine}" +done +exit # Check if logdir exists, and create it if not [[ -d "${LOGDIR}" ]] || mkdir "${LOGDIR}" |