From 39a48487878b0730bd55a1855a54925cda1f294f Mon Sep 17 00:00:00 2001 From: wimpunk Date: Fri, 3 Nov 2006 08:01:41 +0000 Subject: [PATCH] Added patch "Patch: Treat --daemon values as intervals" (submitted by James deBoer) git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk/svn@28 3873ddee-7413-0410-b6c4-c2c57c1ab35a --- Changelog | 3 +++ ddclient | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index 48655af..fddd1e7 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,9 @@ Changelog 3.7.1 - URL of zoneedit has changed (see bug #1558483) - Added initscript for Ubuntu (posted by Paolo Martinelli) +- Added patch "Patch: Treat --daemon values as intervals" + (submitted by James deBoer) + 3.7.0 - Added vi tag diff --git a/ddclient b/ddclient index 647f5d4..94eefc0 100755 --- a/ddclient +++ b/ddclient @@ -593,7 +593,7 @@ do { usage("invalid argument '-use %s'; possible values are:\n%s", $opt{'use'}, join("\n",ip_strategies_usage())) unless exists $ip_strategies{lc opt('use')}; - $daemon = define($opt{'daemon'}, $globals{'daemon'}); + $daemon = $opt{'daemon'}; $daemon = 0 if opt('force'); ## obtain the IP address to use. @@ -979,9 +979,13 @@ sub init_config { $opt{'min-error-interval'} = max(interval(opt('min-error-interval')), interval(default('min-error-interval'))); $opt{'timeout'} = 0 if opt('timeout') < 0; - $opt{'daemon'} = minimum('daemon') - if define($opt{'daemon'},$globals{'daemon'},0) - && define($opt{'daemon'},$globals{'daemon'}) < minimum('daemon'); + + ## only set $opt{'daemon'} if it has been explicitly passed in + if (define($opt{'daemon'},$globals{'daemon'},0)) { + $opt{'daemon'} = interval(opt('daemon')); + $opt{'daemon'} = minimum('daemon') + if ($opt{'daemon'} < minimum('daemon')); + } ## define or modify host options specified on the command-line if (exists $opt{'options'} && defined $opt{'options'}) {