Upgrade-Script

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

Schorsch
Posts: 50
Joined: Wed Dec 10, 2008 8:55 pm

Upgrade-Script

Postby Schorsch » Mon Mar 02, 2009 4:30 pm

Hi,

I wrote a smaller than small script to quickly install a new version of GO.
I'm running GO professional on ubuntu server. One special thing is a custom favicon.ico.
Copy new version in tar.gz format to the webroot (/var/www for me).
Copy license file to webroot.
Start script.

Code: Select all

#! /bin/sh
WEBROOT=/var/www
GOINSTDIR=$WEBROOT/office
GOSERVER="your.go.server/groupoffice"

if [ $# -eq 0 ]
then
  echo "usage: $0 name-of-GO-archive"
  echo "eg   : $0 groupoffice-pro-3.01-stable-5"
  exit 1
fi

if test -s $WEBROOT/$1.tar.gz
then
  if test ! -s $WEBROOT/groupoffice-pro-*-license.txt
  then
    echo "remember to copy license-file groupoffice-pro-*-license.txt to $WEBROOT/, otherwise sync will not work!"
    exit 1
  fi
  tar xvf $WEBROOT/$1.tar.gz
  cp $GOINSTDIR/config.php $WEBROOT/$1/
  cp $GOINSTDIR/favicon.ico $WEBROOT/$1/
  cp $GOINSTDIR/favicon.ico $WEBROOT/$1/themes/Default/images/
  cp $GOINSTDIR/favicon.ico $WEBROOT/$1/themes/ExtJS/images/
  mkdir $WEBROOT/$1/local
  chmod 777 $WEBROOT/$1/local
  chmod 666 $WEBROOT/$1/config.php
  mv $WEBROOT/groupoffice-pro-*-license.txt $WEBROOT/$1/
  mv $GOINSTDIR $GOINSTDIR.pre.$1
  mv $WEBROOT/$1 $GOINSTDIR
  rm $GOINSTDIR.pre.$1/local/cache/*
  echo "open http://$GOSERVER/install/ in browser to run post-install-procedure"
  echo "don't forget to chmod 644 $WEBROOT/office/config.php afterwards"
else
  echo "file $WEBROOT/$1.tar.gz doesn't exist"
fi
Of cause, feel free to make the script perfect. No warranty ;-)

Georg

Who is online

Users browsing this forum: No registered users and 2 guests

cron