Created
June 18, 2012 13:38
-
-
Save ivoba/2948421 to your computer and use it in GitHub Desktop.
SilverStripe3 installer
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/sh | |
#install SilverStripe3 CMS | |
#usage sh install_silverstripe3.sh | |
DEFAULT_BROWSER="/usr/bin/firefox" | |
RELEASE="SilverStripe-cms-v3.0.1.tar.gz" | |
RELEASE_FOLDER="SilverStripe-cms-v3.0.1" | |
echo "-------------- Install $RELEASE from web :) ---------------" | |
echo "Type your Project Folder:" | |
read resp | |
if [ -z $resp ]; then | |
echo "No Project Folder given." | |
exit | |
else | |
PROJECT_DIR=$resp | |
if [ ! -d "$PROJECT_DIR" ];then | |
echo "Path $PROJECT_DIR doesn't exist. Creating..." | |
mkdir "$PROJECT_DIR" | |
fi | |
fi | |
echo "Type your Virtualhost (without http://):" | |
read resp | |
if [ -z $resp ]; then | |
echo "No VirtualHost given. We wont call the launcher!" | |
else | |
VIRTUALHOST=$resp | |
fi | |
echo "change to project folder" | |
cd $PROJECT_DIR | |
echo "download archive $RELEASE" | |
wget "http://www.silverstripe.org/assets/releases/$RELEASE" | |
echo "unpack $RELEASE" | |
tar -xzf $RELEASE | |
echo "cleanup" | |
rm $RELEASE | |
cd $RELEASE_FOLDER | |
pwd | |
cp -R . .. | |
cd .. | |
rm -rf $RELEASE_FOLDER | |
#TODO make user, user-group check | |
echo "temporarily make the files writeable by everyone during the install process" | |
chmod -R 777 .htaccess mysite/_config.php assets/ | |
ls -la | |
if [ ! -z $VIRTUALHOST ]; then | |
echo "run installer" | |
$DEFAULT_BROWSER -new-tab http://$VIRTUALHOST/ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment