Skip to content

Instantly share code, notes, and snippets.

@suth
Created June 8, 2012 14:30

Revisions

  1. suth revised this gist Jun 8, 2012. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -36,5 +36,7 @@ echo
    echo "Configuring WordPress..."
    echo "========================"
    cp wp-config-sample.php wp-config.php
    sed -i '' "s/database_name_here/$domain/g;s/username_here/root/g;s/password_here//g" 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!"
  2. suth created this gist Jun 8, 2012.
    40 changes: 40 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    #! /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;s/username_here/root/g;s/password_here//g" wp-config.php
    echo "Done!"