From 1cc3136421f3f87e92677b6fb0f28b80b5db0a9d Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Wed, 13 Mar 2019 23:38:54 +0000 Subject: [PATCH] Move beef.db back to BeEF root directory --- beef | 4 ++-- config.yaml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/beef b/beef index ca33fb3ce..2e2d83ba2 100755 --- a/beef +++ b/beef @@ -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 diff --git a/config.yaml b/config.yaml index 3912a4d02..5eb785ba6 100644 --- a/config.yaml +++ b/config.yaml @@ -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