1 | #!/usr/bin/env bash
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | if [ -d "/usr/lib/fis-gtm" ]; then
|
10 |
|
11 | echo "GT.M appears to have already been installed - aborting"
|
12 |
|
13 | else
|
14 |
|
15 |
|
16 |
|
17 | echo 'Preparing environment'
|
18 |
|
19 | sudo apt-get update
|
20 | sudo apt-get install -y build-essential libssl-dev
|
21 | sudo apt-get install -y wget gzip openssh-server curl python-minimal libelf1
|
22 |
|
23 |
|
24 |
|
25 | echo 'Installing GT.M'
|
26 |
|
27 | mkdir /tmp/tmp
|
28 | cd /tmp/tmp
|
29 | wget https://sourceforge.net/projects/fis-gtm/files/GT.M%20Installer/v0.13/gtminstall
|
30 | chmod +x gtminstall
|
31 |
|
32 |
|
33 |
|
34 | gtmroot=/usr/lib/fis-gtm
|
35 | gtmcurrent=$gtmroot/current
|
36 | if [ -e "$gtmcurrent"] ; then
|
37 | mv -v $gtmcurrent $gtmroot/previous_`date -u +%Y-%m-%d:%H:%M:%S`
|
38 | fi
|
39 | sudo mkdir -p $gtmcurrent
|
40 |
|
41 |
|
42 | sudo -E ./gtminstall --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent
|
43 |
|
44 | echo 'Configuring GT.M'
|
45 |
|
46 | gtmprof=$gtmcurrent/gtmprofile
|
47 | gtmprofcmd="source $gtmprof"
|
48 | $gtmprofcmd
|
49 | tmpfile=`mktemp`
|
50 | if [ `grep -v "$gtmprofcmd" ~/.profile | grep $gtmroot >$tmpfile`] ; then
|
51 | echo "Warning: existing commands referencing $gtmroot in ~/.profile may interfere with setting up environment"
|
52 | cat $tmpfile
|
53 | fi
|
54 |
|
55 | echo 'copying ' $gtmprofcmd ' to profile...'
|
56 | echo $gtmprofcmd >> ~/.profile
|
57 |
|
58 | rm $tmpfile
|
59 | unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
|
60 |
|
61 | echo 'GT.M has been installed and configured, ready for use'
|
62 | echo 'Enter the GT.M shell by typing the command: gtm Exit it by typing the command H'
|
63 |
|
64 |
|
65 |
|
66 | cd ~
|
67 |
|
68 | fi
|