Merge pull request #153 from rhansen/infer-use

This commit is contained in:
Sandro 2020-06-12 21:30:16 +02:00 committed by GitHub
commit eb4b226af0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -21,6 +21,9 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
minute.
* The `pid` option is now ignored when ddclient is not daemonized.
* ddclient now gracefully exits when interrupted by Ctrl-C.
* The way ddclient chooses the default for the `use` option has changed.
Rather than rely on the default, users should explicitly set the `use`
option.
## 2020-01-08 v3.9.1

View file

@ -1291,9 +1291,11 @@ sub init_config {
$opt{'quiet'} = 0 if opt('verbose');
## infer the IP strategy if possible
$opt{'use'} = 'ip' if !define($opt{'use'}) && defined($opt{'ip'});
$opt{'use'} = 'if' if !define($opt{'use'}) && defined($opt{'if'});
$opt{'use'} = 'web' if !define($opt{'use'}) && defined($opt{'web'});
if (!defined($opt{'use'})) {
$opt{'use'} = 'web' if defined($opt{'web'});
$opt{'use'} = 'if' if defined($opt{'if'});
$opt{'use'} = 'ip' if defined($opt{'ip'});
}
## sanity check
$opt{'max-interval'} = min(interval(opt('max-interval')), interval(default('max-interval')));