From 286fe02478aa48f5ecfbe788fa79e17f58990f91 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 14 Jul 2020 23:13:00 -0400 Subject: [PATCH] Fix `-daemon` command-line argument parsing It turns out the logic removed in d10601de11d287cf8a44a043ed31d658cf219a51 had a purpose after all. --- ddclient.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddclient.in b/ddclient.in index aab4212..93a3b43 100755 --- a/ddclient.in +++ b/ddclient.in @@ -1295,6 +1295,11 @@ sub init_config { $opt{'timeout'} = 0 if opt('timeout') < 0; + ## parse an interval expression (such as '5m') into number of seconds + $opt{'daemon'} = interval(opt('daemon')) if defined($opt{'daemon'}); + ## make sure the interval isn't too short + $opt{'daemon'} = minimum('daemon') if opt('daemon') > 0 && opt('daemon') < minimum('daemon'); + ## define or modify host options specified on the command-line if (exists $opt{'options'} && defined $opt{'options'}) { ## collect cmdline configuration options.