This repository was archived by the owner on Jun 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_install
More file actions
executable file
·77 lines (68 loc) · 2 KB
/
quick_install
File metadata and controls
executable file
·77 lines (68 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
DIRECTORY="/usr/src/quantonium"
ERGW_TARBALL="ergw_tarball"
ERL_FILE_PATH="/usr/bin/erl"
SYS_CONFIG="/opt/ergw-gtp-c-node/releases/1.16.0/sys.config"
VM_ARGS="/opt/ergw-gtp-c-node/releases/1.16.0/vm.args"
ERLANG_VER="1:20.1"
echo "Creating $DIRECTORY directory..."
sudo mkdir -p $DIRECTORY
if [ ! -d "$DIRECTORY" ]; then
echo "Unable to create $DIRECTORY. Exiting."
exit 1
fi
echo "Changing permissions on $DIRECTORY to be +rwx by $USER"
sudo chmod go+rwx $DIRECTORY
cd $DIRECTORY
if [ -d "$ERGW_TARBALL" ]; then
echo "Removing existing clone of ergw repository. "
rm -rf $ERGW_TARBALL
fi
echo "Cloning Quantonium's $GIT_TAR repository"
git clone https://github.com/quantonium/$ERGW_TARBALL.git
if [ ! -d "$ERGW_TARBALL" ]; then
echo "Unable to clone $GIT_TAR. Exiting."
exit 1
fi
cd $ERGW_TARBALL
echo -n "Copying rebar3 to ~/bin..."
cp rebar3 ~/bin
echo done
echo "Updating packages on current system"
sudo apt update
sudo apt -y upgrade
echo "Checking if Erlang version 20.1 is already installed"
x=`dpkg -l |grep esl-erlang |awk '{print $3}' |grep "20.1"`
if [ "$x" = "$ERLANG_VER" ]; then
echo "Erlang version Matched"
else
echo "Erlang version NOT Matched "
echo "Installing Erlang v 20.1"
sudo dpkg -i esl-erlang_20.1-1~ubuntu~xenial_amd64.deb
sudo apt -f install
sudo dpkg -i esl-erlang_20.1-1~ubuntu~xenial_amd64.deb
fi;
if [ ! -f $ERL_FILE_PATH ]; then
echo "Unable to install Erlang. Exiting."
exit 1
fi
echo "Erlang v20.1 installed"
echo "Untarring erGW build environment"
tar xf ergw0424.tar
if [ ! -d "gw" ]; then
echo "Unable to untar erGW environment. Exiting."
exit 1
fi
echo "erGW build time environment copied"
cd gw
echo "Installing erGW run time environment in /opt"
sudo cp -aL _build/default/rel/ergw-gtp-c-node /opt
echo "Copying files"
sudo cp config/sys.config $SYS_CONFIG
sudo cp config/vm.args $VM_ARGS
if [ ! -f $VM_ARGS ]; then
echo "erGW run time installation failure"
exit 1
fi
echo "erGW run time installation completed successfully"
exit 0