From 51ba72ff0826c026243b52e910502f0e1e5235a3 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 30 Jun 2020 17:33:24 -0400 Subject: [PATCH] new cmds for cscli --- src/cscli/main.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cscli/main.ts b/src/cscli/main.ts index 73d8a56..37e5abe 100644 --- a/src/cscli/main.ts +++ b/src/cscli/main.ts @@ -55,6 +55,16 @@ export default class CSCLI { socket.write(`${res}\n`); socket.destroy(); break; + case 'processcount': + const processCount = await this.client.util.exec(`ps -U ${parsed.Username} -u ${parsed.Username} u | wc -l`); + socket.write(`${processCount}\n`); + socket.destroy(); + break; + case 'sshlogins': + const sshLogins = await this.client.util.exec(`who | grep ${parsed.Username} | wc -l`); + socket.write(`${sshLogins}\n`); + socket.destroy(); + break; default: socket.destroy(); break;