New -list-web-services option

This will make it possible for the Debian package to fetch the list of
supported built-in web-based IP discovery services and prompt the user
to choose one upon installation.
This commit is contained in:
Richard Hansen 2020-08-02 16:49:28 -04:00 committed by Sandro Jäckel
parent 69996e9396
commit f5932d8be3
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -884,6 +884,10 @@ my %opt = ();
my $deprecated_handler = sub { warning("'-$_[0]' is deprecated and does nothing"); };
$opt{'fw-banlocal'} = $deprecated_handler;
$opt{'if-skip'} = $deprecated_handler;
$opt{'list-web-services'} = sub {
printf("%s %s\n", $_, $builtinweb{$_}{url}) for sort(keys(%builtinweb));
exit(0);
};
my @opt = (
"usage: ${program} [options]",
@ -921,6 +925,7 @@ my @opt = (
["webv4-skip", "=s", "-webv4-skip <pattern> : skip any IP addresses before <pattern> in the output of 'ip address show dev <interface>' (or 'ifconfig <interface>')"],
["webv6", "=s", "-webv6 <service>|<url>: obtain IPv6 address from a web-based IP discovery service, either a known <service> or a custom <url>"],
["webv6-skip", "=s", "-webv6-skip <pattern> : skip any IP addresses before <pattern> in the output of 'ip address show dev <interface>' (or 'ifconfig <interface>')"],
["list-web-services", "", "-list-web-services : print a machine-readable list of web-based IP discovery services for use with 'web=<service>' and exit. Format: one service per line, each line has the form '<service> <url>'"],
"",
" Options that apply to 'use=fw' and 'use=<device>':",
["fw", "=s", "-fw <address>|<url> : deprecated, use 'fwv4' or 'fwv6'"],
@ -947,8 +952,8 @@ my @opt = (
["ssl", "!", "-{no}ssl : do updates over encrypted SSL connection"],
["ssl_ca_dir", "=s", "-ssl_ca_dir <dir> : look in <dir> 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"],
["web-ssl-validate","!","-{no}web-ssl-validate : Validate SSL certificate when retrieving IP address from web"],
["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"],
["curl", "!", "-{no}curl : use curl for network connections"],
["retry", "!", "-{no}retry : retry failed updates"],
["force", "!", "-{no}force : force an update even if the update may be unnecessary"],