Created
October 29, 2013 14:15
-
-
Save eimg/7215472 to your computer and use it in GitHub Desktop.
Download and install latest version of Wordpress. Only for XAMPP linux on Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Project/DB Name: "; read -e dbname | |
echo "Database User: "; read -e dbuser | |
echo "Database Password: "; read -s dbpass | |
echo "Run the install? (y/n)"; read -e run | |
if [ "$run" == n ] ; then | |
exit | |
else | |
wget http://wordpress.org/latest.tar.gz | |
tar -zxvf latest.tar.gz | |
mv wordpress /opt/lampp/htdocs/$dbname | |
cd /opt/lampp/htdocs/$dbname | |
cp wp-config-sample.php wp-config.php | |
sed -i -e "s/database_name_here/$dbname/g" wp-config.php | |
sed -i -e "s/username_here/$dbuser/g" wp-config.php | |
sed -i -e "s/password_here/$dbpass/g" wp-config.php | |
mkdir wp-content/uploads | |
chmod 777 wp-content/uploads | |
if [ $dbpass ] ; then | |
/opt/lampp/bin/mysql -u $dbuser -p $dbpass -e "create database if not exists $dbname" | |
else | |
/opt/lampp/bin/mysql -u $dbuser -e "create database if not exists $dbname" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment