aboutsummaryrefslogtreecommitdiff
path: root/rcynic/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'rcynic/Makefile.in')
-rw-r--r--rcynic/Makefile.in22
1 files changed, 9 insertions, 13 deletions
diff --git a/rcynic/Makefile.in b/rcynic/Makefile.in
index 623855a3..1be2d912 100644
--- a/rcynic/Makefile.in
+++ b/rcynic/Makefile.in
@@ -219,19 +219,15 @@ ${DESTDIR}${bindir}/validation_status: validation_status
.FORCE:
install-crontab: .FORCE
- @echo "Setting up ${RCYNIC_CRON_USER}'s crontab to run rcynic-cron script"
- @crontab -l -u ${RCYNIC_CRON_USER} 2>/dev/null | \
- ${AWK} -v t=`hexdump -n 2 -e '"%u\n"' /dev/random` '\
- BEGIN { \
- cmd = "exec ${bindir}/rcynic-cron"; \
- } \
- $$0 !~ cmd { \
- print; \
- } \
- END { \
- printf "%u * * * *\t%s\n", t % 60, cmd; \
- }' | \
- /usr/bin/crontab -u ${RCYNIC_CRON_USER} -
+ @if test "X`/usr/bin/crontab -l -u ${RCYNIC_CRON_USER} 2>/dev/null`" != "X"; \
+ then \
+ echo "${RCYNIC_CRON_USER} already has a crontab, leaving it alone"; \
+ else \
+ echo "Setting up ${RCYNIC_CRON_USER}'s crontab to run rcynic-cron script"; \
+ ${AWK} -v t=`hexdump -n 2 -e '"%u\n"' /dev/random` '\
+ BEGIN {printf "%u * * * *\texec ${bindir}/rcynic-cron\n", t % 60}' | \
+ /usr/bin/crontab -u ${RCYNIC_CRON_USER} -; \
+ fi
# Platform-specific rules below here.