I am new to the SSH.NET library and I understand the basics of it such as connecting, executing a command and returning the output.
But my question is, how can I return a true/false statement if I wanted to check if a background process is running or not?
So for example:
using (SshClient client = new SshClient(host, user, pass))
{
client.Connect();
var cmd = client.RunCommand("uname -sn");
string serverResponse = cmd.Result;
Label1.Text = serverResponse;
client.Disconnect();
}
So if I wanted to replace my command with "ps -u user | grep procName" I would like to have it tell me yes or no if said procName is running.
How would I go about this?