From: Darren Date: Tue, 29 Jul 2014 18:13:04 +0000 (+0100) Subject: load/unload modules at runtime X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2aab8fbb83ea44e2fbb41c03af07f113e67e34e8;p=KiwiIRC.git load/unload modules at runtime --- diff --git a/server/controlinterface.js b/server/controlinterface.js index fa8f0e6..e94d055 100644 --- a/server/controlinterface.js +++ b/server/controlinterface.js @@ -167,6 +167,34 @@ commands.module = function(args, raw) { break; + case 'load': + if (!args[1]) { + this.write('A module name must be specified'); + return; + } + + if (!kiwiModules.load(args[1])) { + this.write('Error loading module ' + (args[1] || '')); + } + this.write('Module ' + args[1] + ' loaded'); + + break; + + case 'unload': + if (!args[1]) { + this.write('A module name must be specified'); + return; + } + + if (!kiwiModules.unload(args[1])) { + this.write('Module ' + (args[1] || '') + ' is not loaded'); + return; + } + + this.write('Module ' + args[1] + ' unloaded'); + + break; + case 'list': case 'ls': default: