Changeset

712:56410c0cd846

mod_console: Added module:reload
author Waqas Hussain <waqas20@gmail.com>
date Tue, 13 Jan 2009 22:39:07 +0500
parents 711:7653519ec4f2
children 713:2afd6d9e21cd
files plugins/mod_console.lua
diffstat 1 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_console.lua	Tue Jan 13 22:38:20 2009 +0500
+++ b/plugins/mod_console.lua	Tue Jan 13 22:39:07 2009 +0500
@@ -160,15 +160,24 @@
 	return true, "Module loaded";
 end
 
-function def_env.module:unload(name, host)
-	local mm = require "modulemanager";
-	local ok, err = mm.unload(host or self.env.host, name);
-	if not ok then
-		return false, err or "Unknown error unloading module";
-	end
-	return true, "Module unloaded";
-end
-
+function def_env.module:unload(name, host)
+	local mm = require "modulemanager";
+	local ok, err = mm.unload(host or self.env.host, name);
+	if not ok then
+		return false, err or "Unknown error unloading module";
+	end
+	return true, "Module unloaded";
+end
+
+function def_env.module:reload(name, host)
+	local mm = require "modulemanager";
+	local ok, err = mm.reload(host or self.env.host, name);
+	if not ok then
+		return false, err or "Unknown error reloading module";
+	end
+	return true, "Module reloaded";
+end
+
 def_env.config = {};
 function def_env.config:load(filename, format)
 	local config_load = require "core.configmanager".load;