Jump to content
  • 0

problem with remote acces [RA]


wallker2

Question

Hello guys,

this is not big problem and maybe its easy to fix it but for now i cannot fix it by my own. When php script is executing command througt tellnet core is executing command 2 times in a roq. Php code is ok command is sent only once. Maybe this is easy core fix? Does anyone have this fixed?

here is the php function that sends command

function send_ra_command($user,$pass,$ip,$port, $command)
{
$ok = 0;
   $telnet = @fsockopen($ip, $port, $errno, $errstr, 3);
   if($telnet)
   {
       fgets($telnet,1024);
       $send1 = fputs($telnet, $user."\\n");
       sleep(3);
       $send2 = fputs($telnet, $pass."\\n");
       sleep(3);
       if(($send1) && ($send2))
       {
               $send3 = fputs($telnet, $command."\\n");
                   sleep(3);
                   if($send3)
                   {
                           $ok = 1;
                   }
       }
       fclose($telnet);
   }
   else
       echo "
".$errstr."
";
return $ok;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use