#! /bin/sh # $Id$ ######################################################################## # Aegir quick upgrade script # # This script also *DOES NOT CHECK* if the requirements have been met. # It's up to the admin to follow the proper upgrade instructions or use # the packages provided by their platform. ######################################################################## # basic variables, change before running AEGIR_VERSION=HEAD AEGIR_DOMAIN=aegir.example.com AEGIR_HOME="$HOME" DRUPAL_DIR=$AEGIR_HOME/hostmaster-$AEGIR_VERSION DRUSH_VERSION=6.x-3.3 DRUSH_MAKE_VERSION=6.x-2.0-beta10 OLD_DRUPAL_DIR=$AEGIR_HOME/hostmaster-0.4-beta2 DRUSH_DIR=$AEGIR_HOME/drush DRUSH="php $DRUSH_DIR/drush.php" BACKUP_DIR=$AEGIR_HOME/pre-upgrade-`date '+%F-%H%M'` ######################################################################## # 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 } ######################################################################## # Main script AEGIR_HOST=`uname -n` AEGIR_DOMAIN=${1:-$AEGIR_DOMAIN} msg "Aegir $AEGIR_VERSION automated upgrade script" if [ `whoami` = "root" ] ; then msg "This script should be run as the aegir user, not as root." exit 1 fi msg "This script makes the following assumptions: " cat <