Skip to content

Instantly share code, notes, and snippets.

@erm3nda
Forked from bburky/instant-wordpress.sh
Last active December 10, 2015 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erm3nda/056bb5f20c7fa3943a76 to your computer and use it in GitHub Desktop.
Save erm3nda/056bb5f20c7fa3943a76 to your computer and use it in GitHub Desktop.
Instant wordpress with sqlite3 install automation
#!/bin/bash
# One line original script:
# curl -L https://gio.io/wp.sh | bash
# One line ES_es:
# curl -L https://git.io/v4dSJ | bash
# You can define port by setting variable PORT before exec the script, otherwise fallback to 8080.
# curl -L https://git.io/v4dSJ | PORT=8888 bash
# The directory "wordpress" will be created in the current directory.
test -e wordpress && echo "wordpress/ already exists" && exit
# Get locale info to download proper package.
lang=$(locale | grep LANG | cut -d= -f2 | cut -d_ -f1) # change LANG to LANGUAGE if doesn't work for you.
# Added language support to es_ES
if [[ $lang == "es" ]]; then
# Descargar última versión de Wordpress_ES y extraerla
echo "Descargando y extrayendo la última versión de Wordpress desde https://es.wordpress.org."
curl https://es.wordpress.org/latest-es_ES.tar.gz | tar -zx
else # fallback to English
# Download latest WordPress and extract to wordpress/
echo "Downloading and extracting latest Wordpress version from https://wordpress.org/latest.tar.gz."
curl https://wordpress.org/latest.tar.gz | tar -zx
fi
# Install SQLite Integration to avoid MySQL
# https://wordpress.org/plugins/sqlite-integration/
cd wordpress/wp-content/plugins/
curl -O https://downloads.wordpress.org/plugin/sqlite-integration.1.5.zip
unzip sqlite-integration.1.5.zip
rm sqlite-integration.1.5.zip
mv sqlite-integration/db.php ../
# Open http://localhost:8080 or :PORT
echo
echo "Configure wp-config.php with DUMMY db settings."
echo
( ( sleep 2 &&
# open install in default browser
( type xdg-open && xdg-open "http://localhost:${PORT-8080}/" ) ||
( type open && open "http://localhost:${PORT-8080}/" ) ) & ) >/dev/null 2>&1
# Start the built-in PHP web server
# Requires PHP 5.4.0 or newer
cd ../../
php -S "localhost:${PORT-8080}"
# That's all!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment