forked from FIWARE-TMForum/Business-API-Ecosystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.sh
More file actions
executable file
·57 lines (44 loc) · 1.37 KB
/
setup_env.sh
File metadata and controls
executable file
·57 lines (44 loc) · 1.37 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
#!/bin/bash
if [ -f "/etc/centos-release" ]; then
export DIST="rhel"
CONT=$(cat /etc/centos-release)
if [[ $CONT == *7* ]]; then
echo "7"
export VER="7"
else
export VER="6"
fi
elif [ -f "/etc/issue" ]; then
# This file can exist in Debian and centos
CONTENT=$(cat /etc/issue)
if [[ $CONTENT == *CentOS* ]]; then
export DIST="rhel"
export VER="6"
elif [[ $CONTENT == *Ubuntu* || $CONTENT == *Debian* ]]; then
export DIST="deb"
if [[ $CONTENT == *Debian* ]]; then
export VER="d"
fi
fi
fi
# Install basic dependencies
cd scripts
sudo -E ./resolve-basic-dep.sh
cd ..
# Setup env variables
export PATH=$PATH:/opt/biz-ecosystem/glassfish4/glassfish/bin
export PATH=$PATH:/opt/biz-ecosystem/node-v6.9.1-linux-x64/bin
echo 'export PATH=$PATH:/opt/biz-ecosystem/glassfish4/glassfish/bin' >> ~/.bashrc
echo 'export PATH=$PATH:/opt/biz-ecosystem/node-v6.9.1-linux-x64/bin' >> ~/.bashrc
sudo chown -R $USER:$USER /opt/biz-ecosystem
# Create directories
sudo mkdir /etc/default/rss
sudo chown $USER:$USER /etc/default/rss
/opt/biz-ecosystem/glassfish4/glassfish/bin/asadmin start-domain
if [[ $DIST == "deb" ]]; then
sudo service mysql restart
sudo service mongodb restart
elif [[ $DIST == "rhel" ]]; then
sudo service mysqld restart
sudo service mongod restart
fi