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

Revision 497, 1.5 KB checked in by marcus, 11 years ago (diff)

r257 | walther | 2011-11-24 11:04:33 +0100 (Do, 24. Nov 2011) | 1 Zeile

  • checking for base64 executable since it's not installed by default on some OS
  • 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/Installation"
10echo ""
11read -p "Did you execute all neccessary steps (type 'yes')? " yes
12[ "$yes" = "yes" ] || exit
13
14which base64 > /dev/null 2>&1
15[ $? -eq 0 ] || \
16           (echo "'base64' tool for decoding not found, please install."; exit)
17
18export TMPDIR=`mktemp -d /tmp/selfextract.XXXXXX`
19
20echo "Extracting files to temporary directory ${TMPDIR}..."
21
22ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`
23
24tail -n+$ARCHIVE $0 | base64 -di | tar xz -C $TMPDIR
25
26CDIR=`pwd`
27cd $TMPDIR
28
29# parse options
30while getopts "l:f:v" OPTION
31do
32     case $OPTION in
33         l)
34             LOCSAT=$OPTARG
35             ;;
36         f)
37             FK=$OPTARG
38             ;;
39         v)
40             VERBOSE=1
41             ;;
42     esac
43done
44
45[ "$LOCSAT" = "" ] || LOCSAT="--locsat=$LOCSAT"
46[ "$FK" = "" ] || FK="--fk=$FK"
47[ "$VERBOSE" = "" ] || VERBOSE="--debug"
48
49python ./setup/setup.py $LOCSAT $FK $VERBOSE
50
51result=$?
52
53cd $CDIR
54if [ $result -eq 0 ] ; then
55    echo "Installation successful, removing temporary directory..."
56    rm -rf $TMPDIR
57    exit 0
58else
59    echo "Installation unsuccessful, keeping temporary directory..."
60    echo ""
61    echo "You can restart installation procedure by cd'ing into"
62    echo $TMPDIR "and running ./setup/setup.py [--debug]"
63    exit 1
64fi
65
66__ARCHIVE_BELOW__
Note: See TracBrowser for help on using the repository browser.