new cmds for cscli
parent
5e022b523a
commit
51ba72ff08
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue