UNPKG

2.01 kBapplication/x-shView Raw
1#!/usr/bin/env bash
2
3# run using: source install_yottadb_only.sh
4
5# Acknowledgement: KS Bhaskar for YottaDB installation logic
6
7# run as normal user, eg ubuntu
8
9if [ -d "/usr/lib/yottadb" ]; then
10
11 echo "YottaDB appears to have already been installed - aborting"
12
13else
14
15 # Prepare
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# YottaDB
28
29ydbversion=r1.28
30
31echo "Installing YottaDB $ydbversion"
32
33mkdir /tmp/tmp # Create a temporary directory for the installer
34cd /tmp/tmp # and change to it. Next command is to download the YottaDB installer
35wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
36chmod +x ydbinstall.sh # Make the file executable
37
38
39gtmroot=/usr/lib/yottadb
40gtmcurrent=$gtmroot/current
41if [ -e "$gtmcurrent"] ; then
42 mv -v $gtmcurrent $gtmroot/previous_`date -u +%Y-%m-%d:%H:%M:%S`
43fi
44sudo mkdir -p $gtmcurrent # make sure directory exists for links to current YottaDB
45sudo ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent $ydbversion
46echo "Configuring YottaDB $ydbversion"
47
48gtmprof=$gtmcurrent/gtmprofile
49gtmprofcmd="source $gtmprof"
50$gtmprofcmd
51tmpfile=`mktemp`
52if [ `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
55fi
56
57echo 'copying ' $gtmprofcmd ' to profile...'
58echo $gtmprofcmd >> ~/.profile
59
60rm $tmpfile
61unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
62
63echo 'YottaDB has been installed and configured, ready for use'
64echo 'Enter the YottaDB shell by typing the command: gtm Exit it by typing the command H'
65
66 cd ~
67
68fi