Skip to content

Commit

Permalink
WordPress Database Prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
MiteshShah committed Jun 17, 2013
1 parent 3250af6 commit 3535ea2
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions usr/local/sbin/easyengine
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,6 @@ INSTALLMYSQL()

INSTALLPMA()
{
# Check PMA Directory Exist
#if [ ! -d /var/www/pma ]
#then
# mkdir -p /var/www/pma || OwnError "Unable To Create /var/www/pma Directory"
#fi

# Download PMA
#wget -O /var/www/pma/pma.tar.gz -c http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.3/phpMyAdmin-4.0.3-all-languages.tar.gz \
#|| OwnError "Unable To Download PMA"

# Extract PMA
#cd /var/www/pma
#tar --strip-components=1 -zxvf pma.tar.gz

# Call NGINXUSERINFO Function For NGINX User Details
#NGINXUSERINFO

# Change Ownership
#echo -e "\033[34m Changing Ownership \e[0m"
#chown -R $NGINXUSER:$NGINXUSER /var/www/pma

# Install PMA
echo -e "\033[34m Installing PMA... \e[0m"
sudo $EEAPTGET install phpmyadmin \
Expand Down Expand Up @@ -410,6 +389,7 @@ MYSQLINFO()
fi

read -p "Enter The MySQL Database Name [$DOMAIN]: " WPDBNAME
read -p "Enter The MySQL Database Table Prefix [wp_]" WPDBPREFIX

# If Enter Is Pressed, Then Use localhost as MySQL Host
if [[ $MYSQLHOST = "" ]]
Expand All @@ -425,6 +405,12 @@ MYSQLINFO()
#echo $WPDBNAME
fi

# If Enter Is Pressed, Then Use wp_ As Database Table Prefix
if [[ $WPDBPREFIX = "" ]]
then
WPDBPREFIX=wp_
fi

# Create Database
mysql -u $MYSQLUSER -p$MYSQLPASS -e "create database \`$WPDBNAME\`" \
|| OwnError "Unable To Create $WPDBNAME Database"
Expand Down Expand Up @@ -939,6 +925,9 @@ then
sed -i "s/localhost/$MYSQLHOST/" \
/var/www/$DOMAIN/wp-config.php

sed -i "s/wp_/$WPDBPREFIX/" \
/var/www/$DOMAIN/wp-config.php

printf '%s\n' "g/put your unique phrase here/d" \
a "$(curl -L https://api.wordpress.org/secret-key/1.1/salt/)" . w \
| ed -s /var/www/$DOMAIN/wp-config.php
Expand Down

0 comments on commit 3535ea2

Please sign in to comment.