1
0
Fork 0

update shell

refactor/models
Matthew 2019-11-25 18:25:04 -05:00
parent 3a99c9efa4
commit d2c10b45ad
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ export default class Util {
} }
public async createAccount(hash: string, etcPasswd: string, username: string, userID: string, emailAddress: string, moderatorID: string): Promise<AccountInterface> { public async createAccount(hash: string, etcPasswd: string, username: string, userID: string, emailAddress: string, moderatorID: string): Promise<AccountInterface> {
await this.exec(`useradd -m -p ${hash} -c ${etcPasswd} -s /bin/bash ${username}`); await this.exec(`useradd -m -p ${hash} -c ${etcPasswd} -s /bin/zsh ${username}`);
await this.exec(`chage -d0 ${username}`); await this.exec(`chage -d0 ${username}`);
const account = new this.client.db.Account({ const account = new this.client.db.Account({
@ -175,11 +175,11 @@ export default class Util {
public async deleteAccount(username: string): Promise<void> { public async deleteAccount(username: string): Promise<void> {
const account = await this.client.db.Account.findOne({ username }); const account = await this.client.db.Account.findOne({ username });
if (!account) return Promise.reject(new Error('Account not found')); if (!account) throw new Error('Account not found');
this.exec(`lock ${username}`);
await this.exec(`deluser ${username} --remove-home --backup-to /management/Archives && rm -rf -R /home/${username}`); await this.exec(`deluser ${username} --remove-home --backup-to /management/Archives && rm -rf -R /home/${username}`);
await this.client.removeGuildMemberRole('446067825673633794', account.userID, '546457886440685578', 'Cloud Account Deleted'); await this.client.removeGuildMemberRole('446067825673633794', account.userID, '546457886440685578', 'Cloud Account Deleted');
await this.client.db.Account.deleteOne({ username }); await this.client.db.Account.deleteOne({ username });
return Promise.resolve();
} }
public async messageCollector(message: Message, question: string, timeout: number, shouldDelete = false, choices: string[] = null, filter = (msg: Message): boolean|void => {}): Promise<Message> { public async messageCollector(message: Message, question: string, timeout: number, shouldDelete = false, choices: string[] = null, filter = (msg: Message): boolean|void => {}): Promise<Message> {