mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
Set self{host and delete ping so we can use parent->ping
This commit is contained in:
@@ -128,6 +128,7 @@ sub open {
|
||||
$ADDRESS = $self->{Monitor}->{ControlAddress};
|
||||
}
|
||||
$BASE_URL = $PROTOCOL.$ADDRESS;
|
||||
$$self{host} = $ADDRESS; # For use with ping
|
||||
|
||||
use LWP::UserAgent;
|
||||
$self->{ua} = LWP::UserAgent->new;
|
||||
@@ -231,17 +232,6 @@ sub reboot {
|
||||
$self->get($BASE_URL.'/goform/config?cmd=reboot');
|
||||
}
|
||||
|
||||
sub ping {
|
||||
return -1 if ! $ADDRESS;
|
||||
|
||||
require Net::Ping;
|
||||
|
||||
my $p = Net::Ping->new();
|
||||
my $rv = $p->ping($ADDRESS);
|
||||
$p->close();
|
||||
return $rv;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
|
||||
Reference in New Issue
Block a user