We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6031791 commit 187a044Copy full SHA for 187a044
lib/msf/ui/console/command_dispatcher/db.rb
@@ -1706,6 +1706,15 @@ def cmd_db_connect_help
1706
1707
def cmd_db_connect(*args)
1708
return if not db_check_driver
1709
+ if framework.db.connection_established?
1710
+ cdb = ""
1711
+ ::ActiveRecord::Base.connection_pool.with_connection { |conn|
1712
+ if conn.respond_to? :current_database
1713
+ cdb = conn.current_database
1714
+ end
1715
+ }
1716
+ return print_status("#{framework.db.driver} already connected to #{cdb}")
1717
1718
if (args[0] == "-y")
1719
if (args[1] and not ::File.exists? ::File.expand_path(args[1]))
1720
print_error("File not found")
0 commit comments