Move beef.db back to BeEF root directory

This commit is contained in:
Brendan Coles
2019-03-13 23:38:54 +00:00
parent 20e61d9e81
commit 1cc3136421
2 changed files with 5 additions and 2 deletions

4
beef
View File

@@ -164,7 +164,7 @@ Socket.do_not_reverse_lookup = true
#
case config.get("beef.database.driver")
when "sqlite"
DataMapper.setup(:default, "sqlite3://#{$home_dir}/beef.db")
DataMapper.setup(:default, "sqlite3://#{$root_dir}/#{config.get("beef.database.db_file")}")
when "mysql", "postgres"
DataMapper.setup(:default,
:adapter => config.get("beef.database.driver"),
@@ -194,7 +194,7 @@ begin
rescue => e
print_error "Could not connect to database: #{e.message}"
if config.get("beef.database.driver") == 'sqlite'
print_more "Ensure the #{$home_dir}/beef.db database file is writable"
print_error "Ensure the #{$root_dir}/#{config.get("beef.database.db_file")} database file is writable"
end
exit 1
end

View File

@@ -102,6 +102,9 @@ beef:
# Finally, run a 'bundle install' command and start BeEF.
driver: "sqlite"
# db_file is only used for sqlite
db_file: "beef.db"
# db connection information is only used for mysql/postgres
db_host: "localhost"
db_port: 3306