X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian-security%2Fcron.weekly;h=8843ac1c043be612cda3a2dcf5b7f750cc46a606;hb=96435a89e1ee5581b25eb7b5b1722e987f5b5a44;hp=fc813ecff0e9459f17950d214370b24889204c7a;hpb=6a4cddfbe864e563e671fe5dabf5600c4783af5c;p=dak.git diff --git a/config/debian-security/cron.weekly b/config/debian-security/cron.weekly index fc813ecf..8843ac1c 100755 --- a/config/debian-security/cron.weekly +++ b/config/debian-security/cron.weekly @@ -1,18 +1,37 @@ -#!/bin/sh +#!/bin/bash # # Executed weekly via cron, out of dak's crontab. set -e -export SCRIPTVARS=/org/security.debian.org/dak/config/debian-security/vars +set -o pipefail +export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars . $SCRIPTVARS +LOCKFILE="$lockdir/unchecked.lock" + ################################################################################ # Weekly generation of release files, then pushing mirrors. # Used as we have a "Valid-until" field in our release files of 10 days. In case # we dont have a security update in that time... -cd $masterdir +cd $configdir + +cleanup() { + rm -f "$LOCKFILE" +} + +if ! lockfile -r100 "$LOCKFILE"; then + echo "Could not lock $LOCKFILE. Assuming resigning is not needed." + exit 0 +fi +trap cleanup EXIT + dak generate-releases + +cleanup +trap - EXIT + +/srv/security-master.debian.org/dak/config/debian-security/make-mirror.sh sudo -u archvsync -H /home/archvsync/signal_security