lots of changed, though it'll probably be all backed-out because
[configmanager.git] / lib / genericssh.plugin.php
1 <?php 
2
3 function genericssh_ssh($host, $username, $password, $command)
4 {
5         $connector = ssh2_connect("$host");
6         error_log("attempting connect to $host with $username");
7         if($connector) {
8                 error_log("connector true");
9         } else {
10                 error_log("connector false");
11         }
12         ssh2_auth_password($connector, "$username", "$password");
13         $stream = ssh2_exec($connector, "$command");
14         stream_set_blocking($stream, true);
15
16         $config = stream_get_contents($stream);
17         
18         return $config;
19 }
20
21 ?>