From db995b772d82379550761fe6b4db455afecf31dd Mon Sep 17 00:00:00 2001 From: pedia Date: Tue, 10 Dec 2019 09:33:38 +0800 Subject: [PATCH 1/2] - --- lib/client.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/client.dart b/lib/client.dart index 542cae7..6cda43d 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -585,6 +585,13 @@ class SSHClient extends SSHTransport with SSHAgentForwarding { '', false)); } + + void exec(String command, {bool wantReply = true}) { + assert(socket != null && sessionChannel != null); + if (socket == null || sessionChannel == null) return; + writeCipher(MSG_CHANNEL_REQUEST.exec( + sessionChannel.remoteId, 'shell', '', wantReply)); + } } /// Implement same [SocketInterface] as actual [Socket] but over [SSHClient] tunnel. From 69ec717c65491b6e0dc90f2d7ff4c7f2711e6ccb Mon Sep 17 00:00:00 2001 From: pedia Date: Wed, 11 Dec 2019 09:13:45 +0800 Subject: [PATCH 2/2] add exec --- lib/client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.dart b/lib/client.dart index 6cda43d..8dd4cad 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -590,7 +590,7 @@ class SSHClient extends SSHTransport with SSHAgentForwarding { assert(socket != null && sessionChannel != null); if (socket == null || sessionChannel == null) return; writeCipher(MSG_CHANNEL_REQUEST.exec( - sessionChannel.remoteId, 'shell', '', wantReply)); + sessionChannel.remoteId, 'exec', command, wantReply)); } }