diff --git a/cmds/owner/reboot.js b/cmds/owner/reboot.js new file mode 100644 index 0000000..2b96d99 --- /dev/null +++ b/cmds/owner/reboot.js @@ -0,0 +1,24 @@ +'use strict'; + +const commando = require("@iceprod/discord.js-commando"), + { exec } = require("child_process"), + { errLog, trySend } = require("../../resources/functions"); + +module.exports = class reboot extends commando.Command { + constructor(client) { + super(client, { + name: "reboot", + memberName: "reboot", + group: "owner", + description: "Reboot Shasha.", + ownerOnly: true, + guarded: true + }); + } + + async run(msg) { + await trySend(msg.client, msg, "Cyaa~"); + exec("pm2 restart --name shasha"); + process.exit(); + } +} \ No newline at end of file diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..3057846 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,22 @@ +module.exports = { + apps: [{ + script: 'Main.js', + watch: '.' + }, { + script: './service-worker/', + watch: ['./service-worker'] + }], + + deploy: { + production: { + user: 'SSH_USERNAME', + host: 'SSH_HOSTMACHINE', + ref: 'origin/master', + repo: 'GIT_REPOSITORY', + path: 'DESTINATION_PATH', + 'pre-deploy-local': '', + 'post-deploy': 'npm install && pm2 reload ecosystem.config.js --env production', + 'pre-setup': '' + } + } +};