Skip to content

Commit 36797a3

Browse files
committed
Include next run time in init output
1 parent 2b909ec commit 36797a3

1 file changed

Lines changed: 11 additions & 1 deletion

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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ CRON_MINS=$((0 + RANDOM % 59))
55

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

8-
echo "[mod-init] Mod updates will run every 6 hours at ${CRON_MINS} minutes past the hour"
8+
if [[ $(date "+%H") -gt 0 && $(date "+%H") -lt 6 ]]; then
9+
NEXT_HOUR=6
10+
elif [[ $(date "+%H") -gt 6 && $(date "+%H") -lt 12 ]]; then
11+
NEXT_HOUR=12
12+
elif [[ $(date "+%H") -gt 12 && $(date "+%H") -lt 18 ]]; then
13+
NEXT_HOUR=18
14+
else [[ $(date "+%H") -gt 18 && $(date "+%H") -le 23 ]];
15+
NEXT_HOUR=0
16+
fi
17+
18+
echo "[mod-init] Mod updates will run every 6 hours at ${CRON_MINS} minutes past the hour. Next update will be at ${NEXT_HOUR}:${CRON_MINS}."
919

1020
/app/update-mods.sh

0 commit comments

Comments
 (0)