Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 25th, 2010  |  syntax: PHP  |  size: 0.58 KB  |  views: 838  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. require_once "bras_config.php";
  3. require_once "PHPTelnet.php";
  4.  
  5. set_time_limit ( 180);
  6.  
  7. $telnet = new PHPTelnet();
  8. //$telnet->show_connect_error=1;
  9. //$telnet->use_usleep=1;
  10.  
  11. // if the first argument to Connect is blank,
  12. // PHPTelnet will connect to the local host via 127.0.0.1
  13. $result = $telnet->Connect(BRAS_HOST,BRAS_ADMIN,BRAS_PASS);
  14.  
  15.  
  16. dmp("Telnet connect returns: $result");echo '<hr/>';
  17. if ($result ==0) {
  18.         $telnet->DoCommand('enable', $result);
  19.         dmp($result);
  20.         sleep(1);
  21.         $telnet->DoCommand('show subscribers username user@isp', $result);
  22.         dmp($result);
  23. }
  24.  
  25. $telnet->Disconnect();
  26. exit;
clone this paste RAW Paste Data