Created
June 8, 2012 14:30
-
-
Save suth/2895907 to your computer and use it in GitHub Desktop.
Quick WordPress Instance
This file contains hidden or 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 | |
clear | |
echo "WordPress Instance Setup" | |
echo "========================" | |
echo | |
echo "Enter a domain for your site" | |
read domain | |
mkdir $domain | |
cd $domain | |
echo | |
echo "Downloading the latest version of WordPress..." | |
echo "========================" | |
curl -O "http://wordpress.org/latest.tar.gz" | |
echo | |
echo "Extracting WordPress..." | |
echo "========================" | |
tar -zxf latest.tar.gz | |
rm latest.tar.gz | |
mv wordpress/* ./ | |
mv wordpress/.* ./ | |
rmdir wordpress | |
echo "Done!" | |
echo | |
echo "Creating database..." | |
echo "========================" | |
sudo mysqladmin create $domain | |
echo "Created MySQL database named" $domain | |
echo | |
echo "Configuring WordPress..." | |
echo "========================" | |
cp wp-config-sample.php wp-config.php | |
sed -i '' "s/database_name_here/$domain/g" wp-config.php | |
sed -i '' "s/username_here/root/g" wp-config.php | |
sed -i '' "s/password_here//g" wp-config.php | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment