Fix: avoid duplicate cron entries when switching build frequency

This commit is contained in:
maride 2024-06-28 00:32:10 +02:00
parent 682960d450
commit 737b529b8d

View File

@ -9,8 +9,9 @@ if [ "$BUILDFREQ" == "" ]; then
fi fi
# Run the pull script regularly # Run the pull script regularly
cmd="$BUILDFREQ * * * * /aux/pull-n-build.sh" target="/aux/pull-n-build.sh"
grep "$cmd" /var/spool/cron/crontabs/root || echo "$cmd" >> /var/spool/cron/crontabs/root entry="$BUILDFREQ * * * * $target"
grep "$target" /var/spool/cron/crontabs/root || echo "$entry" >> /var/spool/cron/crontabs/root
# start cron daemon (goes into background) # start cron daemon (goes into background)
crond crond