Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
410.pkg-audit should use anticongestion on FreeBSD 12
Alan Somers committed 9 years ago
commit ba329960bb6d7ae28bd2b8bd35225025420f0fab
parent 5ce39fe
1 file changed +6 -2
modified scripts/periodic/410.pkg-audit.in
@@ -55,8 +55,12 @@ audit_pkgs() {
	if [ $rc -ne 0 -o \
		$(( 86400 \* "${daily_status_security_pkgaudit_expiry:-2}" )) \
		-le $(( ${now} - ${then} + 600 )) ]; then
-
		# Random delay so the mirrors do not get slammed when run by periodic(8)
-
		if [ ! -t 0 ]; then
+
		# When non-interactive, sleep to reduce congestion on mirrors
+
		if [ -n "$anticongestion_sleeptime" ]; then
+
			# In FreeBSD 12.0 the anticongestion function should be
+
			# used instead of a hard-coded sleep
+
			anticongestion
+
		else
			sleep `jot -r 1 0 3600`
		fi
		${pkgcmd} ${pkgargs} audit -F $q || { rc=$?; [ $rc -lt 3 ] && rc=3; }