fix bullshit
parent
1bc6b7c625
commit
4773c9f952
|
@ -22,13 +22,13 @@ export default class ResetPassword extends Command {
|
|||
|
||||
const msg = await this.loading(message.channel, `Resetting password for ${account.username}...`);
|
||||
const tempPass = this.client.util.randomPassword();
|
||||
await this.client.util.exec(`echo '${account.username}:${tempPass}' | chpasswd && chage -d0 ${account.username}`);
|
||||
await this.client.util.exec(`echo '${account.username}:${tempPass}@' | chpasswd && chage -d0 ${account.username}`);
|
||||
|
||||
let completeMessage = `${this.client.stores.emojis.success} ***Password for ${account.username} reset to \`${tempPass}\`***`;
|
||||
let completeMessage = `${this.client.stores.emojis.success} ***Password for ${account.username} reset to \`${tempPass}@\`***`;
|
||||
const dmChannel = await this.client.getDMChannel(account.userID);
|
||||
try {
|
||||
await dmChannel.createMessage(`We received a password reset request from you, your new password is \`${tempPass}\`.\n`
|
||||
+ `You will be asked to change your password when you log back in, \`(current) UNIX password\` is \`${tempPass}\`, then create a password that is at least 12 characters long, with at least one number, special character, and an uppercase letter.\n`
|
||||
await dmChannel.createMessage(`We received a password reset request from you, your new password is \`${tempPass}@\`.\n`
|
||||
+ `You will be asked to change your password when you log back in, \`(current) UNIX password\` is \`${tempPass}@\`, then create a password that is at least 12 characters long, with at least one number, special character, and an uppercase letter.\n`
|
||||
+ 'Bear in mind that when you enter your password, it will be blank, so be careful not to type in your password incorrectly.');
|
||||
} catch (error) {
|
||||
if (error.code === 50007) completeMessage += '\n*Unable to DM user*';
|
||||
|
|
|
@ -15,11 +15,12 @@ export default class SystemD_Status extends Command {
|
|||
if (!args[0]) return this.client.commands.get('help').run(message, ['systemd', this.name]);
|
||||
const account = await this.client.db.Account.findOne({ userID: message.author.id }).lean().exec();
|
||||
if (!account) return this.error(message.channel, 'You do not have a Cloud Services account.');
|
||||
let cmd: string;
|
||||
let cmd: string = '';
|
||||
try {
|
||||
cmd = await this.client.util.exec(`runuser ${account.username} -c 'DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/\${UID}/bus" systemctl --user status ${args[0]}'`);
|
||||
cmd += await this.client.util.exec(`runuser ${account.username} -c 'DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/\${UID}/bus" systemctl --user status ${args[0]}'`);
|
||||
} catch (err) {
|
||||
if (err.toString().includes('could not be found')) return this.error(message.channel, 'The service name you provided doesn\'t exist.');
|
||||
return this.error(message.channel, err.toString());
|
||||
}
|
||||
const embed = new RichEmbed();
|
||||
embed.setTitle(`SystemD Status | ${args[0]}`);
|
||||
|
|
Loading…
Reference in New Issue