aboutsummaryrefslogtreecommitdiff
path: root/dns/ddclient/files/ddclient_force.in
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2017-05-20 02:27:54 +0000
committerAlan Somers <asomers@FreeBSD.org>2017-05-20 02:27:54 +0000
commit41a8b72ca8519c41fe4894fb35eed6432b18dd6d (patch)
tree7ad43e30b6c6f30ef8d162e630a1c0d838ef3ae6 /dns/ddclient/files/ddclient_force.in
parent89e9977d0c5ee2cc8fef42368e4f91a039de179d (diff)
downloadports-41a8b72ca8519c41fe4894fb35eed6432b18dd6d.tar.gz
ports-41a8b72ca8519c41fe4894fb35eed6432b18dd6d.zip
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)
Notes
Notes: svn path=/head/; revision=441283
Diffstat (limited to 'dns/ddclient/files/ddclient_force.in')
-rw-r--r--dns/ddclient/files/ddclient_force.in13
1 files changed, 10 insertions, 3 deletions
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