DBDL=$(curl -s https://www.phpbb.com/downloads/ | grep .zip | head -1 | awk '{ print $2 }' | sed 's/href="//' | sed 's/">Download//')
wget $DBDL
VER=$(echo $DBDL | sed 's/.*phpBB//')
DL="phpBB"$VER
unzip $DL
mkdir -p /var/www/html/forum
cd /temp/phpBB3
cp -r * /var/www/html/forum
rm -rf /temp
cd /var/www/html/forum
chmod 777 config.php
chmod 777 files
chmod 777 cache
chmod 777 store
#set database name and host
newDb='forum'
host=localhost
DBQUESTIONS(){
clear;echo;echo
cat <<EOF
The following information is needed
to create the database that will be
used by the PHPBB forum software.
EOF
#get database user name & password
read -p "Please enter a user name for your database " newUser
read -p "Please enter a password for your database " newDbPassword
#verify info
echo "User name - "$newUser
echo "Password - "$newDbPassword
read -p "Is this correct y/n " ANS
if [ "$ANS" = 'y' ] || [ "$ANS" = 'Y' ]
then
commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*