diff options
author | Guillaume Mazoyer <respawneral@gmail.com> | 2014-06-18 15:59:38 +0200 |
---|---|---|
committer | Guillaume Mazoyer <respawneral@gmail.com> | 2014-06-18 15:59:38 +0200 |
commit | 8bab0d8735603683ea7ba18a2248257368ece16f (patch) | |
tree | 4852730841a212e88d69ba3f19dca70a3f76d830 | |
parent | 401bffb0ba1280a59910d9e89adab4676e17b647 (diff) |
Fix send_command() in telnet.
-rw-r--r-- | auth/telnet.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/auth/telnet.php b/auth/telnet.php index f490148..628e602 100644 --- a/auth/telnet.php +++ b/auth/telnet.php @@ -42,8 +42,8 @@ final class Telnet extends Authentication { throw new Exception('Cannot connect to router.'); } - fputs($this->connection, $this->config['user']."\r"); - fputs($this->connection, $this->config['pass']."\r"); + fputs($this->connection, $this->config['user']."\r\n"); + fputs($this->connection, $this->config['pass']."\r\n"); } public function send_command($command) { @@ -51,6 +51,8 @@ final class Telnet extends Authentication { $this->connect(); } + fputs($this->connection, $command."\r\n"); + $data = ''; while(!feof(!$this->connection)) { $data .= fread($this->connection, 4096); |