#! /bin/sh # $Id: install.sh.txt,v 1.23 2009/11/13 07:40:10 mig5 Exp $ ######################################################################## # Aegir quick install script # # This script takes care of deploying all the required PHP scripts for # the frontend to run properly. It should be ran as the Aegir user. # # It should keep to strict POSIX shell syntax to ensure maximum # portability. The aim here is to ease the burden on porters but also # allow people using various platforms to zip through the install quicker. # # Eventually, all this should be performed by the Provision backend. # # This script also *DOES NOT CHECK* if the requirements have been met. # It's up to the admin to follow the proper install instructions or use # the packages provided by their platform. ######################################################################## # basic variables, change before release AEGIR_DOMAIN=aegir.example.com AEGIR_VERSION=6.x-0.4-alpha3 AEGIR_HOME=$HOME WEB_GROUP=www-data DRUSH="$AEGIR_HOME/drush/drush.php" DRUSH_VERSION=All-Versions-2.1 # when adding a variable here, add it to the display below # no configurable settings below this line HOSTMASTER_DIR=$AEGIR_HOME/hostmaster-$AEGIR_VERSION ######################################################################## # functions # noticeable messages msg() { echo "==> $*" } # simple prompt prompt_yes_no() { while true ; do printf "$* [Y/n] " read answer if [ -z "$answer" ] ; then return 0 fi case $answer in [Yy]|[Yy][Ee][Ss]) return 0 ;; [Nn]|[Nn][Oo]) return 1 ;; *) echo "Please answer yes or no" ;; esac done } usage() { cat < /dev/null ; then msg "Drush is in the path, good" DRUSH=drush elif [ -x $DRUSH ] ; then msg "Drush found in $DRUSH, good" DRUSH="php $AEGIR_HOME/drush/drush.php" else msg "Installing drush in $AEGIR_HOME" cd $AEGIR_HOME wget http://ftp.drupal.org/files/projects/drush-$DRUSH_VERSION.tar.gz tar -xzf drush-$DRUSH_VERSION.tar.gz rm drush-$DRUSH_VERSION.tar.gz DRUSH="php $AEGIR_HOME/drush/drush.php" fi if $DRUSH help > /dev/null ; then msg "Drush seems to be functionning properly" else msg "Drush is broken ($DRUSH help failed)" exit 1 fi if ! $DRUSH help | grep -q "^ make" ; then msg "Installing drush make in $AEGIR_HOME/.drush" mkdir -p $AEGIR_HOME/.drush $DRUSH dl drush_make --destination=$AEGIR_HOME/.drush else msg "Drush make already seems to be installed" fi if ! $DRUSH help | grep -q "^ provision install" ; then msg "Installing provision backend in $AEGIR_HOME/.drush" mkdir -p $AEGIR_HOME/.drush if [ "$AEGIR_VERSION" = "HEAD" ]; then ( cd $AEGIR_HOME && cvs -d ":pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal" co -d .drush/provision contributions/modules/provision ) else $DRUSH dl provision-$AEGIR_VERSION --destination=$AEGIR_HOME/.drush fi else msg "Provision already seems to be installed" fi if ! [ -e $HOSTMASTER_DIR ] ; then msg "Deploying hostmaster application" $DRUSH hostmaster make $HOSTMASTER_DIR cd $HOSTMASTER_DIR mkdir sites/$AEGIR_DOMAIN cp sites/default/default.settings.php sites/$AEGIR_DOMAIN/settings.php chmod g+w sites/$AEGIR_DOMAIN/settings.php mkdir sites/$AEGIR_DOMAIN/files chmod 2770 sites/$AEGIR_DOMAIN/files chgrp $WEB_GROUP sites/$AEGIR_DOMAIN/settings.php chgrp $WEB_GROUP sites/$AEGIR_DOMAIN/files fi if ! [ -e $AEGIR_HOME/config/vhost.d/$AEGIR_DOMAIN ]; then sed -e "s#DocumentRoot .*#DocumentRoot $HOSTMASTER_DIR#" -e "s#Directory .*#Directory $HOSTMASTER_DIR>#" -e "s/ServerName .*/ServerName $AEGIR_DOMAIN/" $HOSTMASTER_DIR/profiles/hostmaster/apache2.conf.txt > $AEGIR_HOME/config/vhost.d/$AEGIR_DOMAIN msg "Installed apache configuration file for $AEGIR_DOMAIN, you will need to restart apache" fi msg "Install process complete: follow the wizard" cat <