Skip to content

Commit 1360701

Browse files
committed
Try using minutes instead of months
1 parent 49be799 commit 1360701

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • root/etc/s6-overlay/s6-rc.d/init-modmanager-config

root/etc/s6-overlay/s6-rc.d/init-modmanager-config/run

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ CRON_MINS=$((0 + RANDOM % 59))
55

66
sed -i "s/@@MINUTES@@/${CRON_MINS}/" /etc/crontabs/root
77

8-
if [[ $(date "+%-H") == 0 && $(date "+%-m") -lt ${CRON_MINS} ]]; then
8+
if [[ $(date "+%-H") == 0 && $(date "+%-M") -lt ${CRON_MINS} ]]; then
99
NEXT_HOUR=0
10-
elif [[ $(date "+%-H") == 6 && $(date "+%-m") -lt ${CRON_MINS} ]]; then
10+
elif [[ $(date "+%-H") == 6 && $(date "+%-M") -lt ${CRON_MINS} ]]; then
1111
NEXT_HOUR=6
12-
elif [[ $(date "+%-H") == 12 && $(date "+%-m") -lt ${CRON_MINS} ]]; then
12+
elif [[ $(date "+%-H") == 12 && $(date "+%-M") -lt ${CRON_MINS} ]]; then
1313
NEXT_HOUR=12
14-
elif [[ $(date "+%-H") == 18 && $(date "+%-m") -lt ${CRON_MINS} ]]; then
14+
elif [[ $(date "+%-H") == 18 && $(date "+%-M") -lt ${CRON_MINS} ]]; then
1515
NEXT_HOUR=18
1616
elif [[ $(date "+%-H") -ge 0 && $(date "+%-H") -le 5 ]]; then
1717
NEXT_HOUR=6
@@ -23,7 +23,7 @@ elif [[ $(date "+%-H") -ge 18 && $(date "+%-H") -le 23 ]]; then
2323
NEXT_HOUR=0
2424
fi
2525

26-
echo "[mod-init] Mod updates will run every 6 hours at ${CRON_MINS} minutes past the hour. Next update will be at $(date -d${NEXT_HOUR}:${CRON_MINS} '+%H:%m')."
26+
echo "[mod-init] Mod updates will run every 6 hours at ${CRON_MINS} minutes past the hour. Next update will be at $(date -d${NEXT_HOUR}:${CRON_MINS} '+%H:%M')."
2727

2828
printf %s "${DOCKER_MODS}" > /run/s6/container_environment/DOCKER_MODS_STATIC
2929

0 commit comments

Comments
 (0)