rename installed to installed?

This commit is contained in:
dwelch-r7
2021-04-20 12:29:17 +01:00
parent 45db5c178a
commit f11129349b
+3 -20
View File
@@ -309,23 +309,6 @@ def write_db_config
File.chmod(0640, @db_conf)
end
def write_db_client_auth_config
client_auth_config = "#{@pg_cluster_conf_root}/#{get_postgres_version}/#{@options[:msf_db_name]}/pg_hba.conf"
puts "Writing client authentication configuration file #{client_auth_config}"
File.open(client_auth_config, 'w') do |f|
f.puts "host \"#{@options[:msf_db_name]}\" \"#{@options[:msf_db_user]}\" 127.0.0.1/32 md5"
f.puts "host \"#{@options[:msftest_db_name]}\" \"#{@options[:msftest_db_user]}\" 127.0.0.1/32 md5"
f.puts "host \"postgres\" \"#{@options[:msftest_db_user]}\" 127.0.0.1/32 md5"
f.puts "host \"template1\" all 127.0.0.1/32 trust"
if Gem.win_platform?
f.puts "host all all 127.0.0.1/32 trust"
f.puts "host all all ::1/128 trust"
else
f.puts "local all all trust"
end
end
end
def update_db_port
if File.file?(@db_conf)
config = YAML.load(File.read(@db_conf))
@@ -969,7 +952,7 @@ def invoke_command(commands, component, command)
end
end
def installed(cmd)
def installed?(cmd)
!Msf::Util::Helper.which(cmd).nil?
end
@@ -1036,10 +1019,10 @@ if $PROGRAM_NAME == __FILE__
abort
end
if installed("pg_ctl")
if installed?("pg_ctl")
abort unless has_requirements
@db_driver = PgCtl.new(db_path: @db, options: @options, localconf: @localconf, db_conf: @db_conf)
elsif installed("pg_ctlcluster")
elsif installed?("pg_ctlcluster")
@db_driver = PgCtlcluster.new(db_path: @db, options: @options, localconf: @localconf, db_conf: @db_conf)
else
abort