Prompt user before deleting all DB data

GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-08-06 17:44:44 -04:00
parent c6a976820f
commit 956bc2fa4f
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 7 additions and 3 deletions

10
msfdb
View File

@ -313,10 +313,14 @@ end
def delete_db
if Dir.exist?(@db)
puts "Deleting all data at #{@db}"
stop_db
FileUtils.rm_rf(@db)
if File.exist?(@db_conf) && ask_yn("Delete database configuration at #{@db_conf}?")
if ask_yn("Delete all data at #{@db}?")
puts "Deleting all data at #{@db}"
FileUtils.rm_rf(@db)
end
if File.file?(@db_conf) && ask_yn("Delete database configuration at #{@db_conf}?")
File.delete(@db_conf)
end
else