#!/bin/sh installdir=`pwd` echo "" echo "***** Greenstone 3 (v0.1a) - Self Installer *****" echo "" echo "This program will install Greenstone 3 in a folder" echo "called gsdl3." echo "" # Prompt for the directory to install GSDL3 in echo "Please enter the path to the folder you want to" echo "install Greenstone 3 in, or press enter to accept" echo "the default [$installdir]." printf "%s" "> " read ans if [ "$ans" != "" ] ; then installdir="$ans" fi # Wait message echo "" echo "Extracting Greenstone 3 to: $installdir" echo "This may take a moment. Please wait..." echo "" # Figure out where the TGZ portion starts SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0` # Take the TGZ portion of this file and pipe it to tar. tail +$SKIP $0 | gzip -d -c | tar -xC $installdir -f - # execute the installation script cd $installdir/gsdl3/ source ./gs3-setup.sh chmod u+x gs3-finalise.sh sh ./gs3-finalise.sh exit 0 __ARCHIVE_FOLLOWS__