aboutsummaryrefslogtreecommitdiff
path: root/buildtools/debian-skeleton
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-03-26 01:19:09 +0000
committerRob Austein <sra@hactrn.net>2013-03-26 01:19:09 +0000
commitb330d6450e50cf52258e825981a192e4d1cd272f (patch)
treeab6ae4564b7cdfbef95ca724e7e48e74210ec4dd /buildtools/debian-skeleton
parenta0895f4d6d7f306d241c6a1e742723b34f4ee7cc (diff)
Don't overwrite existing rcynic crontab. Fixes #493.
svn path=/trunk/; revision=5216
Diffstat (limited to 'buildtools/debian-skeleton')
-rw-r--r--buildtools/debian-skeleton/rpki-rp.postinst13
1 files changed, 6 insertions, 7 deletions
diff --git a/buildtools/debian-skeleton/rpki-rp.postinst b/buildtools/debian-skeleton/rpki-rp.postinst
index b343f2a2..63720f13 100644
--- a/buildtools/debian-skeleton/rpki-rp.postinst
+++ b/buildtools/debian-skeleton/rpki-rp.postinst
@@ -31,13 +31,12 @@ setup_rcynic_group() {
# on repositories, which is why we don't just use a package crontab.
setup_rcynic_cron() {
- crontab -l -u rcynic 2>/dev/null |
- awk -v t=`hexdump -n 2 -e '"%u\n"' /dev/urandom` '
- BEGIN { cmd = "exec /usr/bin/rcynic-cron" }
- $0 !~ cmd { print }
- END { printf "%u * * * *\t%s\n", t % 60, cmd }
- ' |
- crontab -u rcynic -
+ if test "X`crontab -l -u rcynic 2>/dev/null`" = "X"
+ then
+ awk -v t=`hexdump -n 2 -e '"%u\n"' /dev/urandom` '
+ BEGIN {printf "%u * * * *\texec /usr/bin/rcynic-cron\n", t % 60}' |
+ crontab -u rcynic -
+ fi
}
setup_rpki_rtr_listener() {