From 737b529b8d0e51cd6d849b506a327047d90cb6c3 Mon Sep 17 00:00:00 2001 From: maride Date: Fri, 28 Jun 2024 00:32:10 +0200 Subject: [PATCH] Fix: avoid duplicate cron entries when switching build frequency --- init/cron.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init/cron.sh b/init/cron.sh index 563ced8..b84c770 100755 --- a/init/cron.sh +++ b/init/cron.sh @@ -9,8 +9,9 @@ if [ "$BUILDFREQ" == "" ]; then fi # Run the pull script regularly -cmd="$BUILDFREQ * * * * /aux/pull-n-build.sh" -grep "$cmd" /var/spool/cron/crontabs/root || echo "$cmd" >> /var/spool/cron/crontabs/root +target="/aux/pull-n-build.sh" +entry="$BUILDFREQ * * * * $target" +grep "$target" /var/spool/cron/crontabs/root || echo "$entry" >> /var/spool/cron/crontabs/root # start cron daemon (goes into background) crond