#!/bin/sh
#
-# Run at the beginning of the month via cron, out of dak's crontab.
+# Run daily via cron, out of dak's crontab.
set -e
set -u
################################################################################
+TMPFILE=$( mktemp -p ${TMPDIR} )
+
+function cleanup {
+ ERRVAL=$?
+ rm -f ${TMPFILE}
+ exit ${ERRVAL}
+}
+trap cleanup SIGHUP SIGINT SIGPIPE SIGTERM EXIT ERR
# get the latest list of wnpp bugs and their source packages
-wget -q -O/srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm http://qa.debian.org/data/bts/wnpp_rm
+wget -q -O${TMPFILE} http://qa.debian.org/data/bts/wnpp_rm
+mv ${TMPFILE} /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm
+chgrp ftpteam /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm
+chmod g+r /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm
################################################################################