Skip to content

Instantly share code, notes, and snippets.

@suth

suth/gist:2895907

Created Jun 8, 2012
Embed
What would you like to do?
Quick WordPress Instance
#! /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
You can’t perform that action at this time.