From 41a8b72ca8519c41fe4894fb35eed6432b18dd6d Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 20 May 2017 02:27:54 +0000 Subject: [PATCH] Use anticongestion in dns/ddclient Introduced in src r316342, the anticongestion feature unifies multiple periodic scripts' disparate sleeps. PR: 218442 Approved by: mjl@luckie.org.nz (maintainer) Approved by: brd (ports) --- dns/ddclient/Makefile | 2 +- dns/ddclient/files/ddclient_force.in | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 2f2c35c8bdbf..0bcdb45fd685 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -3,7 +3,7 @@ PORTNAME= ddclient PORTVERSION= 3.8.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= dns MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} diff --git a/dns/ddclient/files/ddclient_force.in b/dns/ddclient/files/ddclient_force.in index 871e8643bb92..28a2f043a51a 100644 --- a/dns/ddclient/files/ddclient_force.in +++ b/dns/ddclient/files/ddclient_force.in @@ -16,9 +16,16 @@ case "$daily_ddclient_force_enable" in echo echo 'Forcing ddclient update:' - out=`%%PREFIX%%/sbin/ddclient -force` - echo "$out" - rc=0 + # sleep randomly to reduce congestion on dyn dns server. In + # FreeBSD 12.0 the anticongestion function should be used + # instead of a hard-coded sleep + if [ -n "$anticongestion_sleeptime" ]; then + anticongestion + else + sleep `jot -r 1 0 900` + fi + + %%PREFIX%%/sbin/ddclient -force || rc=3 ;; *) rc=0