diff options
Diffstat (limited to '')
-rw-r--r-- | server/src/commands/admin/saveconfig.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js new file mode 100644 index 0000000..e1a3ebe --- /dev/null +++ b/server/src/commands/admin/saveconfig.js @@ -0,0 +1,34 @@ +/* + +*/ + +'use strict'; + +exports.run = async (core, server, socket, data) => { + if (socket.uType != 'admin') { + // ignore if not admin + return; + } + + let saveResult = core.managers.config.save(); + + if (!saveResult) { + server.reply({ + cmd: 'warn', + text: 'Failed to save config, check logs.' + }, client); + + return; + } + + server.broadcast({ + cmd: 'info', + text: 'Config saved!' + }, { uType: 'mod' }); +}; + +exports.info = { + name: 'saveconfig', + usage: 'saveconfig', + description: 'Saves current config' +}; |