source: SH_SHM/branches/2011.2/setup/decompress.sh @ 364

Revision 364, 1.4 KB checked in by marcus, 12 years ago (diff)

MERGE: [358/SH_SHM/trunk] and [363/SH_SHM/trunk]

  • Property svn:executable set to *
Line 
1#! /bin/bash
2
3echo ""
4echo "Self Extracting Installer for Seismic Handler"
5echo ""
6
7echo "Please read and execute all installation instructions for your"
8echo "operating system as explained at the Seismic Handler project website:"
9echo "http://www.seismic-handler.org/portal/wiki/ShmSeismicHandler"
10echo ""
11read -p "Did you execute all neccessary steps (type 'yes')? " yes
12[ "$yes" = "yes" ] || exit
13
14export TMPDIR=`mktemp -d /tmp/selfextract.XXXXXX`
15
16echo "Extracting files to temporary directory ${TMPDIR}..."
17
18ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`
19
20tail -n+$ARCHIVE $0 | base64 -d | tar xz -C $TMPDIR
21
22CDIR=`pwd`
23cd $TMPDIR
24
25# parse options
26while getopts "l:f:v" OPTION
27do
28     case $OPTION in
29         l)
30             LOCSAT=$OPTARG
31             ;;
32         f)
33             FK=$OPTARG
34             ;;
35         v)
36             VERBOSE=1
37             ;;
38     esac
39done
40
41[ "$LOCSAT" = "" ] || LOCSAT="--locsat=$LOCSAT"
42[ "$FK" = "" ] || FK="--fk=$FK"
43[ "$VERBOSE" = "" ] || VERBOSE="--debug"
44
45python ./setup/setup.py $LOCSAT $FK $VERBOSE
46
47result=$?
48
49cd $CDIR
50if [ $result -eq 0 ] ; then
51    echo "Installation successful, removing temporary directory..."
52    rm -rf $TMPDIR
53    exit 0
54else
55    echo "Installation unsuccessful, keeping temporary directory..."
56    echo ""
57    echo "You can restart installation procedure by cd'ing into"
58    echo $TMPDIR "and running ./setup/setup.py [--debug]"
59    exit 1
60fi
61
62__ARCHIVE_BELOW__
Note: See TracBrowser for help on using the repository browser.