-
-
Save erm3nda/056bb5f20c7fa3943a76 to your computer and use it in GitHub Desktop.
Instant wordpress with sqlite3 install automation
This file contains 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 | |
# 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