Fail nicely when load aggregator.

master
Green-m 2019-03-21 17:16:03 +08:00
parent af941b7541
commit 3ff7a4a639
No known key found for this signature in database
GPG Key ID: 7A4A0E684B5D6747
1 changed files with 9 additions and 1 deletions

View File

@ -5,7 +5,6 @@
#
# $Revision$
#
require "metasploit/aggregator"
module Msf
Aggregator_yaml = "#{Msf::Config.get_config_root}/aggregator.yaml" # location of the aggregator.yml containing saved aggregator creds
@ -499,6 +498,15 @@ module Msf
def initialize(framework, opts)
super
#
# Require the metasploit/aggregator gem, but fail nicely if it's not there.
#
begin
require "metasploit/aggregator"
rescue LoadError
raise "WARNING: metasploit/aggregator is not avaiable for now."
end
add_console_dispatcher(AggregatorCommandDispatcher)
print_status("Aggregator interaction has been enabled")
end