Update RPC functionality

bug/bundler_fix
William Vu 2017-01-12 19:16:11 -06:00
parent 601a88dad7
commit 0800a4f816
1 changed files with 9 additions and 8 deletions

View File

@ -57,15 +57,16 @@ class RPC_Plugin < RPC_Base
# @example Here's how you would use this from the client:
# rpc.call('plugin.unload', 'nexpose')
def rpc_unload(name)
self.framework.plugins.each { |plugin|
# Unload the plugin if it matches the name we're searching for
if (plugin.name == name)
self.framework.plugins.unload(plugin)
return { "result" => "success" }
end
}
return { "result" => "failure" }
# Find a plugin within the plugins array
plugin = self.framework.plugins.find { |p| p.name == name }
# Unload the plugin if it matches the name we're searching for
if plugin
self.framework.plugins.unload(plugin)
return { "result" => "success" }
end
return { "result" => "failure" }
end