un poco turbio
This commit is contained in:
@@ -51,25 +51,25 @@ sub candy{
|
||||
|
||||
sub isOn{return grep(/\s$server_name/,sendT("host:list()"))? 1:0; }
|
||||
|
||||
sub sendT{
|
||||
sub sendT{
|
||||
commandT(shift);
|
||||
my @r = $t->getlines(All=>0);
|
||||
return @r
|
||||
}
|
||||
sub connectT{
|
||||
}
|
||||
sub connectT{
|
||||
$t = new Net::Telnet ( Port=>5582, Timeout=>1, Errmode=>'return' );
|
||||
# $t = new Net::Telnet ( Port=>5582, Timeout=>1, Errmode=>'die' );
|
||||
return 1 if $t->open();
|
||||
return 0;
|
||||
}
|
||||
sub commandT{
|
||||
}
|
||||
sub commandT{
|
||||
$t->getlines(All=>0);#empty buffer
|
||||
$t->print(shift); #run istruction
|
||||
}
|
||||
sub disconnectT{ $t->close();}
|
||||
}
|
||||
sub disconnectT{ $t->close();}
|
||||
|
||||
#=========================================================
|
||||
1
|
||||
1;
|
||||
__END__
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user