Browse Source

Land #11603, Fail nicely when load aggregator.

Jeffrey Martin 5 months ago
parent
commit
582f86b75c
No account linked to committer's email address
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      plugins/aggregator.rb

+ 9
- 1
plugins/aggregator.rb View File

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

Loading…
Cancel
Save