Avoid adding to crontab multiple times

This commit is contained in:
maride 2023-11-29 17:30:10 +01:00
parent e4e6da1bca
commit 682960d450

View File

@ -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