Remove the (broken and unused?) --retry option

This commit is contained in:
Richard Hansen 2024-08-17 00:50:45 -04:00
parent 555359dc98
commit b9ec2d42a3
3 changed files with 2 additions and 18 deletions

View file

@ -48,6 +48,8 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
removed. [#716](https://github.com/ddclient/ddclient/pull/716) removed. [#716](https://github.com/ddclient/ddclient/pull/716)
* `googledomains`: Support was removed because the service shut down. * `googledomains`: Support was removed because the service shut down.
[#716](https://github.com/ddclient/ddclient/pull/716) [#716](https://github.com/ddclient/ddclient/pull/716)
* The `--retry` option was removed.
[#732](https://github.com/ddclient/ddclient/pull/732)
### New features ### New features

View file

@ -599,7 +599,6 @@ our %variables = (
'cmdv6' => setv(T_PROG, 0, 0, undef, undef), 'cmdv6' => setv(T_PROG, 0, 0, undef, undef),
'timeout' => setv(T_DELAY, 0, 0, interval('120s'), interval('120s')), 'timeout' => setv(T_DELAY, 0, 0, interval('120s'), interval('120s')),
'retry' => setv(T_BOOL, 0, 0, 0, undef),
'force' => setv(T_BOOL, 0, 0, 0, undef), 'force' => setv(T_BOOL, 0, 0, 0, undef),
'ssl' => setv(T_BOOL, 0, 0, 1, undef), 'ssl' => setv(T_BOOL, 0, 0, 1, undef),
'syslog' => setv(T_BOOL, 0, 0, 0, undef), 'syslog' => setv(T_BOOL, 0, 0, 0, undef),
@ -1221,7 +1220,6 @@ my @opt = (
["ssl_ca_file", "=s", "--ssl_ca_file=<file> : look at <file> for certificates of trusted certificate authorities (default: auto-detect)"], ["ssl_ca_file", "=s", "--ssl_ca_file=<file> : look at <file> for certificates of trusted certificate authorities (default: auto-detect)"],
["fw-ssl-validate", "!", "--{no}fw-ssl-validate : Validate SSL certificate when retrieving IP address from firewall"], ["fw-ssl-validate", "!", "--{no}fw-ssl-validate : Validate SSL certificate when retrieving IP address from firewall"],
["web-ssl-validate", "!", "--{no}web-ssl-validate : Validate SSL certificate when retrieving IP address from web"], ["web-ssl-validate", "!", "--{no}web-ssl-validate : Validate SSL certificate when retrieving IP address from web"],
["retry", "!", "--{no}retry : Initiate a one-time update attempt for hosts that have not been successfully updated (according to the cache). Incompatible with '--daemon'"],
["force", "!", "--{no}force : force an update even if the update may be unnecessary"], ["force", "!", "--{no}force : force an update even if the update may be unnecessary"],
["timeout", "=i", "--timeout=<max> : when fetching a URL, wait at most <max> seconds for a response"], ["timeout", "=i", "--timeout=<max> : when fetching a URL, wait at most <max> seconds for a response"],
["syslog", "!", "--{no}syslog : log messages to syslog"], ["syslog", "!", "--{no}syslog : log messages to syslog"],
@ -1937,23 +1935,11 @@ sub init_config {
# if they are not associated with a host via `--host=` or `--options=host=`)? # if they are not associated with a host via `--host=` or `--options=host=`)?
} }
## sanity check
if (defined(opt('host')) && opt('retry')) {
fatal("options --retry and --host (or --option host=..) are mutually exclusive");
}
fatal("options --retry and --daemon cannot be used together") if (opt('retry') && opt('daemon'));
## determine hosts to update (those on the cmd-line, config-file, or failed in recap) ## determine hosts to update (those on the cmd-line, config-file, or failed in recap)
my @hosts = keys %config; my @hosts = keys %config;
if (opt('host')) { if (opt('host')) {
@hosts = split_by_comma($opt{'host'}); @hosts = split_by_comma($opt{'host'});
} }
# TODO: The first two times init_config() is called the cache file has not been read yet, so
# this will not filter out any hosts and thus updates will not be limited to non-good hosts as
# intended.
if (opt('retry')) {
@hosts = grep(($recap{$_}{'status'} // '') ne 'good', keys(%recap));
}
## remove any other hosts ## remove any other hosts
my %hosts; my %hosts;

View file

@ -10,7 +10,3 @@
## force an update twice a month (only if you are not using daemon-mode) ## force an update twice a month (only if you are not using daemon-mode)
## ##
## 30 23 1,15 * * root /usr/bin/ddclient -daemon=0 -syslog -quiet -force ## 30 23 1,15 * * root /usr/bin/ddclient -daemon=0 -syslog -quiet -force
######################################################################
## retry failed updates every hour (only if you are not using daemon-mode)
##
## 0 * * * * root /usr/bin/ddclient -daemon=0 -syslog -quiet retry