From 682960d450295ead501e153c81d4f45e1270741c Mon Sep 17 00:00:00 2001 From: maride Date: Wed, 29 Nov 2023 17:30:10 +0100 Subject: [PATCH] Avoid adding to crontab multiple times --- init/cron.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/cron.sh b/init/cron.sh index 72825be..563ced8 100755 --- a/init/cron.sh +++ b/init/cron.sh @@ -9,7 +9,8 @@ if [ "$BUILDFREQ" == "" ]; then fi # Run the pull script regularly -echo "*/$BUILDFREQ * * * * /aux/pull-n-build.sh" >> /var/spool/cron/crontabs/root +cmd="$BUILDFREQ * * * * /aux/pull-n-build.sh" +grep "$cmd" /var/spool/cron/crontabs/root || echo "$cmd" >> /var/spool/cron/crontabs/root # start cron daemon (goes into background) crond