Set self{host and delete ping so we can use parent->ping

This commit is contained in:
Isaac Connor
2025-09-09 17:09:10 -04:00
parent bf4e87307a
commit dd2738c58e

View File

@@ -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__