Created
March 16, 2010 09:36
-
-
Save kirkegaard/333793 to your computer and use it in GitHub Desktop.
installs wordpress in your current directory
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 | |
CURRENT_PATH=`pwd` | |
INSTALL_FOLDER="public_html" | |
METHOD="HTTP" | |
HTTP_SOURCE="http://wordpress.org/latest.tar.gz" | |
SVN_SOURCE="http://core.svn.wordpress.org/trunk/" | |
trap cleanup INT | |
function cleanup() { | |
echo "" | |
echo "" | |
echo "Cleaning up" | |
echo "===========" | |
echo "Removing: ${INSTALL_FOLDER}" | |
rm -rf "${CURRENT_PATH}/${INSTALL_FOLDER}" | |
} | |
function showOptions() { | |
echo "" | |
echo "Please select install method:" | |
echo "1) SVN" | |
echo "2) HTTP" | |
read opt; | |
case ${opt} in | |
1) METHOD="SVN";; | |
2) METHOD="HTTP";; | |
*) showOptions;; | |
esac | |
echo "" | |
} | |
function install_http() { | |
echo "Installing using http" | |
echo "=====================" | |
mkdir ${INSTALL_FOLDER} | |
curl -Lsf ${HTTP_SOURCE} | tar xvz --strip 1 -C${INSTALL_FOLDER} | |
} | |
function install_svn() { | |
echo "Installing using svn" | |
echo "====================" | |
svn co http://core.svn.wordpress.org/trunk/ ${INSTALL_FOLDER} | |
} | |
showOptions | |
if [ "$METHOD" = "HTTP" ] ; then | |
install_http | |
elif [ "$METHOD" = "SVN" ] ; then | |
install_svn | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment