source: SH_SHM/trunk/setup/decompress.sh @ 363

Revision 363, 1.4 KB checked in by marcus, 11 years ago (diff)

r197 | walther | 2011-04-06 14:12:17 +0200 (Mi, 06 Apr 2011) | 1 line

Installation wrapper now supports command line parameters for fk/locsat/debug.

  • 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.