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)
This commit is contained in:
Alan Somers 2017-05-20 02:27:54 +00:00
parent 89e9977d0c
commit 41a8b72ca8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=441283
2 changed files with 11 additions and 4 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= ddclient PORTNAME= ddclient
PORTVERSION= 3.8.3 PORTVERSION= 3.8.3
PORTREVISION= 2 PORTREVISION= 3
CATEGORIES= dns CATEGORIES= dns
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}

View file

@ -16,9 +16,16 @@ case "$daily_ddclient_force_enable" in
echo echo
echo 'Forcing ddclient update:' echo 'Forcing ddclient update:'
out=`%%PREFIX%%/sbin/ddclient -force` # sleep randomly to reduce congestion on dyn dns server. In
echo "$out" # FreeBSD 12.0 the anticongestion function should be used
rc=0 # 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 rc=0