Good port choosen
This commit is contained in:
garnier-quentin 2014-05-09 17:49:11 +02:00
parent 20dd599226
commit a475404d1f
1 changed files with 8 additions and 1 deletions

View File

@ -108,6 +108,13 @@ sub check_options {
$self->{output}->option_exit();
}
$self->{cache_port} = '';
if (defined($self->{option_results}->{port}) && $self->{option_results}->{port} ne '') {
$self->{cache_port} = $self->{option_results}->{port};
} else {
$self->{cache_port} = 80 if ($self->{option_results}->{proto} eq 'http');
$self->{cache_port} = 443 if ($self->{option_results}->{proto} eq 'https');
}
$self->{statefile_value}->check_options(%options);
}
@ -130,7 +137,7 @@ sub run {
}
$rPerSec = '0' . $rPerSec if ($rPerSec =~ /^\./);
$self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . $self->{option_results}->{port} . '_' . $self->{mode});
$self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . $self->{cache_port} . '_' . $self->{mode});
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
my $old_total_access = $self->{statefile_value}->get(name => 'total_access');
my $old_total_bytes = $self->{statefile_value}->get(name => 'total_bytes');