1
0
Fork 0

new cmds for cscli

refactor/models
Matthew 2020-06-30 17:33:24 -04:00
parent 5e022b523a
commit 51ba72ff08
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 10 additions and 0 deletions

View File

@ -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;