forked from mganguli/RSC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_valence.sh
executable file
·42 lines (31 loc) · 1.35 KB
/
install_valence.sh
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
#!/bin/bash -
#title :install_valence.sh
#description :This script will install valence package and deploys conf files
#author :Intel Corporation
#date :21-09-2016
#version :0.1
#usage :bash mkscript.sh
#notes :Run this script as sudo user and not as root.
# This script is needed still valence is packaged in to .deb/.rpm
#==============================================================================
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $USER
cd $DIR
echo "Executing the script inside "
pwd
# Copy the config files
sed s/\${CHUID}/$USER/ $DIR/doc/source/init/valence-api.conf > /tmp/valence-api.conf
sudo mv /tmp/valence-api.conf /etc/init/valence-api.conf
sed s/\${CHUID}/$USER/ $DIR/doc/source/init/valence-controller.conf > /tmp/valence-controller.conf
sudo mv /tmp/valence-controller.conf /etc/init/valence-controller.conf
# create conf directory for valence
sudo mkdir /etc/valence
sudo chown ${USER}:${USER} /etc/valence
sudo cp etc/valence/valence.conf.sample /etc/valence/valence.conf
# create log directory for valence
sudo mkdir /var/log/valence
sudo chown ${USER}:${USER} /var/log/valence
python setup.py install --user
echo "Installation Completed"
echo "To start api : service valence-api start"
echo "To start controller : service valence-controller start"