new cscli cmd

merge-requests/4/head
Matthew 2020-07-07 05:29:34 -04:00
parent ea35c19844
commit 4d02a5feef
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
5 changed files with 10 additions and 4 deletions

View File

@ -7,7 +7,7 @@ export default class SystemD_Restart extends Command {
this.name = 'restart'; this.name = 'restart';
this.description = `Restarts a SystemD user service, if the service has never been started or isn't running use \`${this.client.config.prefix}systemd start <service name>\`.`; this.description = `Restarts a SystemD user service, if the service has never been started or isn't running use \`${this.client.config.prefix}systemd start <service name>\`.`;
this.usage = `${this.client.config.prefix}systemd restart <service name>`; this.usage = `${this.client.config.prefix}systemd restart <service name>`;
this.enabled = true; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {

View File

@ -7,7 +7,7 @@ export default class SystemD_Start extends Command {
this.name = 'start'; this.name = 'start';
this.description = `Starts a SystemD user service, if the service is already running use \`${this.client.config.prefix}systemd restart <service name>\`.`; this.description = `Starts a SystemD user service, if the service is already running use \`${this.client.config.prefix}systemd restart <service name>\`.`;
this.usage = `${this.client.config.prefix}systemd start <service name>`; this.usage = `${this.client.config.prefix}systemd start <service name>`;
this.enabled = true; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {

View File

@ -7,7 +7,7 @@ export default class SystemD_Status extends Command {
this.name = 'status'; this.name = 'status';
this.description = 'Prints out the status of a SystemD service that you run.'; this.description = 'Prints out the status of a SystemD service that you run.';
this.usage = `${this.client.config.prefix}systemd status <service name.`; this.usage = `${this.client.config.prefix}systemd status <service name.`;
this.enabled = true; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {

View File

@ -7,7 +7,7 @@ export default class SystemD_Stop extends Command {
this.name = 'stop'; this.name = 'stop';
this.description = 'Stops a SystemD user service.'; this.description = 'Stops a SystemD user service.';
this.usage = `${this.client.config.prefix}systemd stop <service name>`; this.usage = `${this.client.config.prefix}systemd stop <service name>`;
this.enabled = true; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {

View File

@ -65,6 +65,12 @@ export default class CSCLI {
socket.write(`${sshLogins}\n`); socket.write(`${sshLogins}\n`);
socket.destroy(); socket.destroy();
break; break;
case 'ramlimit':
const account = await this.client.db.Account.findOne({ username: parsed.Username }).lean().exec();
const tier = await this.client.db.Tier.findOne({ 'resourceLimits.ram': account.tier }).lean().exec();
socket.write(`${tier.resourceLimits.ram}`);
socket.destroy();
break;
default: default:
socket.destroy(); socket.destroy();
break; break;