1 | #!/usr/bin/env bash
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | if [ -d "/usr/lib/yottadb" ]; then
|
10 |
|
11 | echo "YottaDB 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 | if [[ "$PLATFORM" == "armv"* ]]; then
|
24 | sudo ln -s /lib/arm-linux-gnueabihf/libncursesw.so.6 /lib/arm-linux-gnueabihf/libncurses.so.5
|
25 | fi
|
26 |
|
27 |
|
28 |
|
29 | ydbversion=r1.28
|
30 |
|
31 | echo "Installing YottaDB $ydbversion"
|
32 |
|
33 | mkdir /tmp/tmp
|
34 | cd /tmp/tmp
|
35 | wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
|
36 | chmod +x ydbinstall.sh
|
37 |
|
38 |
|
39 | gtmroot=/usr/lib/yottadb
|
40 | gtmcurrent=$gtmroot/current
|
41 | if [ -e "$gtmcurrent"] ; then
|
42 | mv -v $gtmcurrent $gtmroot/previous_`date -u +%Y-%m-%d:%H:%M:%S`
|
43 | fi
|
44 | sudo mkdir -p $gtmcurrent
|
45 | sudo ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent $ydbversion
|
46 | echo "Configuring YottaDB $ydbversion"
|
47 |
|
48 | gtmprof=$gtmcurrent/gtmprofile
|
49 | gtmprofcmd="source $gtmprof"
|
50 | $gtmprofcmd
|
51 | tmpfile=`mktemp`
|
52 | if [ `grep -v "$gtmprofcmd" ~/.profile | grep $gtmroot >$tmpfile`] ; then
|
53 | echo "Warning: existing commands referencing $gtmroot in ~/.profile may interfere with setting up environment"
|
54 | cat $tmpfile
|
55 | fi
|
56 |
|
57 | echo 'copying ' $gtmprofcmd ' to profile...'
|
58 | echo $gtmprofcmd >> ~/.profile
|
59 |
|
60 | rm $tmpfile
|
61 | unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
|
62 |
|
63 | echo 'YottaDB has been installed and configured, ready for use'
|
64 | echo 'Enter the YottaDB shell by typing the command: gtm Exit it by typing the command H'
|
65 |
|
66 | cd ~
|
67 |
|
68 | fi
|