From d2c10b45adebdf108d3504560b3755929cd3d85c Mon Sep 17 00:00:00 2001 From: Matthew R Date: Mon, 25 Nov 2019 18:25:04 -0500 Subject: [PATCH] update shell --- src/class/Util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 513c3b8..24b0cd1 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -164,7 +164,7 @@ export default class Util { } public async createAccount(hash: string, etcPasswd: string, username: string, userID: string, emailAddress: string, moderatorID: string): Promise { - 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}`); const account = new this.client.db.Account({ @@ -175,11 +175,11 @@ export default class Util { public async deleteAccount(username: string): Promise { 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.client.removeGuildMemberRole('446067825673633794', account.userID, '546457886440685578', 'Cloud Account Deleted'); 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 {