Skip to content

Instantly share code, notes, and snippets.

@suth
Created June 8, 2012 14:30
Show Gist options
  • Save suth/2895907 to your computer and use it in GitHub Desktop.
Save suth/2895907 to your computer and use it in GitHub Desktop.
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