Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created June 18, 2012 13:38
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 ivoba/2948421 to your computer and use it in GitHub Desktop.
Save ivoba/2948421 to your computer and use it in GitHub Desktop.
SilverStripe3 installer
#!/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