From b16b3e7a7db2ed9bf1c65bc011bdfd0dff0f74cf Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 27 Jul 2017 23:28:40 -0700 Subject: [PATCH] perl warnings fixes --- virtual_feature.pl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/virtual_feature.pl b/virtual_feature.pl index 66997f9..e8f9e51 100644 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -211,8 +211,11 @@ sub feature_setup my @listen = &virtualmin_nginx::find("listen", $server); my ($old_ip4) = grep { $_->{'words'}->[0] eq $d->{'ip'}.":".$d->{'web_sslport'} } @listen; -my ($old_ip6) = grep { $_->{'words'}->[0] eq +my $old_ip6; +if ($d->{'ip6'}) { + ($old_ip6) = grep { $_->{'words'}->[0] eq "[".$d->{'ip6'}."]:".$d->{'web_sslport'} } @listen; + } my @sslopts; if (!&find_listen_clash($d->{'ip'}, $d->{'web_sslport'})) { push(@sslopts, 'default', 'ssl'); @@ -249,9 +252,10 @@ sub feature_setup # Add this IP and cert to Webmin/Usermin's SSL keys list my %vinfo = &get_module_info("virtual-server"); -my $canipkeys = $d->{'virt'} || $vinfo{'version'} >= 5.08; -my $rwfunc = $vinfo{'version'} >= 5.08 ? \&virtual_server::restart_webmin_fully - : \&virtual_server::restart_webmin; +my $nv = &compare_version_numbers($vinfo{'version'}, 5.08) >= 0; +my $canipkeys = $d->{'virt'} || $nv; +my $rwfunc = $nv ? \&virtual_server::restart_webmin_fully + : \&virtual_server::restart_webmin; if ($tmpl->{'web_webmin_ssl'} && $canipkeys) { &virtual_server::setup_ipkeys($d, \&get_miniserv_config, @@ -447,8 +451,9 @@ sub feature_delete # Delete per-IP SSL cert my %vinfo = &get_module_info("virtual-server"); -my $rwfunc = $vinfo{'version'} >= 5.08 ? \&virtual_server::restart_webmin_fully - : \&virtual_server::restart_webmin; +my $nv = &compare_version_numbers($vinfo{'version'}, 5.08) >= 0; +my $rwfunc = $nv ? \&virtual_server::restart_webmin_fully + : \&virtual_server::restart_webmin; &virtual_server::delete_ipkeys($d, \&get_miniserv_config, \&put_miniserv_config,