public void SudoReboot() { using (var client = Ssh()) { var wrapper = new SshClientWrapper(client); wrapper.SudoReboot(); } }
public string SudoBash(string command) { using (var client = Ssh()) { var result = new SshClientWrapper(client).RunSudoBash(command); return(result); } }
public string CommandWithStdIn(string command, string stdIn) { using (var client = Ssh()) { var wrapper = new SshClientWrapper(client); var result = wrapper.RunWithStdIn(command, new string[] { stdIn }); return(result); } }
public string ScriptWithStdIn(string scriptContent, string scriptName, string[] inputs) { using (var scpClient = Scp()) { var stream = new MemoryStream(Encoding.UTF8.GetBytes(scriptContent)); scpClient.Upload(stream, scriptName); } using (var client = Ssh()) { var wrapper = new SshClientWrapper(client); var result = wrapper.RunWithStdIn("sh " + scriptName, inputs); return(result); } }