Changeset 856


Ignore:
Timestamp:
Aug 14, 2018, 5:05:00 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Use id_rsa instead of id_dsa for airos devices.
Location:
trunk/Modules/NetworkConfigAirOS/Generators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigAirOS/Generators/SSHClient.php

    r753 r856  
    1717    $this->Password = $Password;
    1818    $this->Debug = false;
    19     $this->PrivateKey = 'id_dsa';
     19    $this->PrivateKey = '~/.ssh/id_rsa';
    2020    $this->SSHPath = '/usr/bin/ssh';
    2121    $this->Timeout = 3;
     
    3030      $Commands = str_replace('$', '\$', $Commands);
    3131      //$Commands = str_replace(' ', '\ ', $Commands);
    32       $Command = $this->SSHPath.' -o ConnectTimeout='.$this->Timeout.' -l '.
    33         $this->UserName.' -i '.$this->PrivateKey.' '.$this->HostName.' "'.$Commands.'"';
     32      if ($this->PrivateKey != '') $PrivKey = ' -i '.$this->PrivateKey;
     33        else $PrivKey = '';
     34      $Command = $this->SSHPath.' -oBatchMode=yes -o ConnectTimeout='.$this->Timeout.' -l '.
     35        $this->UserName.$PrivKey.' '.$this->HostName.' "'.$Commands.'"';
    3436      if($this->Debug) echo($Command);
    3537      $Output = array();
  • trunk/Modules/NetworkConfigAirOS/Generators/Signal.php

    r814 r856  
    1515    while($Device = $DbResult3->fetch_assoc())
    1616    {
    17       echo($Device['LocalIP']."\n");
     17      echo($Device['LocalIP']."");
    1818      $SSHClient = new SSHClient($Device['LocalIP'], $Device['LoginName'], $Device['LoginPassword']);
     19      //$SSHClient->Debug = true;
    1920      $Result = $SSHClient->Execute('wstalist');
    20       print_r($Result);
     21      if (count($Result) > 0)
     22      {     
     23      //print_r($Result);
    2124      $Array = json_decode(implode("\n", $Result), true);
    22       print_r($Array);
     25      //print_r($Array);
     26      echo('-');
    2327      foreach($Array as $Properties)
    2428      {
     
    3640          'Value' => $Strength, 'RateRx' => $RateRx, 'RateTx' => $RateTx,
    3741          'Time' => TimeToMysqlDateTime($Time), 'Interface' => $Interface, 'Device' => $Device['Id']));
     42        echo('.');
    3843      }
     44      echo("\n");
     45      } else echo("Empty response\n");
     46     
    3947    }
    4048  }
Note: See TracChangeset for help on using the changeset viewer.