##install postgres
echo "Installing postgres... (If not already installed)"
sudo service postgresql stop
$sudo apt-get purge postgresql*
$sudo apt-get install postgresql
sudo apt-get install postgresql -y
#
##Setup postgres server
echo "Setting up Postgres server..."
sudo -u postgres 'createuser msf -P -S -R -D'
sudo -u postgres 'createdb -O msf msf'
su postgres
cd
createuser msf -P -S -R -D
createdb -O msf msf
#
##Create database.yml file
echo "Creating database.yml file..."
sudo mkdir /opt/metasploit-framework/config
sudo echo "production:
adapter: postgresql
database: msf
username: msf
password: msf
host: 127.0.0.1
port: 5432
pool: 75
timeout: 5" >> /opt/metasploit-framework/config/database.yml
sudo sh -c "echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/config/database.yml >> /etc/profile"
source /etc/profile
#
Комментарии
4