#!/bin/bash
#
# Creates PIMPPA's SQL database, tables and user
#

echo
echo Creating pimppa database. If asked, enter your MySQl root password.
echo
mysql -u root -p <create_database.sql

echo
echo Checking ~/.my.cnf
echo 

if [ ! -e ~/.my.cnf ]; then
	echo Config file \"~/.my.cnf\" doesnt exist, copying a default one.
	echo You SHOULD change the password in it AND in the actual database 
	echo \(See file SETUP\)!
	echo
	cp default.cnf ~/.my.cnf
	chmod 0600 ~/.my.cnf
else
	echo You already have \"~/.my.cnf\". You should update your mysql 
	echo accesses to give your old user access to database \"pimppa\"
	echo and its tables. PIMPPA's file SETUP has an example.
	echo
fi

