Skip attempts to restart database on failures

GSoC/Meterpreter_Web_Console
Erin Bleiweiss 2019-01-22 13:55:06 -06:00
parent 60a69f086b
commit 3e949a49c7
No known key found for this signature in database
GPG Key ID: F69B2138BD594660
1 changed files with 6 additions and 12 deletions

18
msfdb
View File

@ -183,23 +183,13 @@ def start_db
update_db_port
while !started_db
if !started_db
last_log = tail("#{@db}/log")
puts last_log
fixed = false
if last_log =~ /not compatible/
puts 'Please attempt to upgrade the database manually using pg_upgrade.'
end
if !fixed
if ask_yn('Your database may be corrupt, would you like to reinitialize it?')
fixed = reinit_db
end
end
if !fixed
if !ask_yn('Database not started, try again?')
return
end
end
print_error "Your database may be corrupt. Try reinitializing by running #{'msfdb reinit --component database'.underline}."
end
end
@ -400,6 +390,10 @@ def ask_password(question)
end
end
def print_error(error)
puts "#{'[!]'.red} #{error}"
end
def delete_db
if Dir.exist?(@db)
stop_db