Fixed shellcheck error and warning on install_valence.sh
shellcheck error and warning on install_valence.sh is fixed and also replaced tab with four spaces for indentation purpose Change-Id: Id8983045945e12514acb64401502330478b4b8c9 Closes-Bug: #1650699
This commit is contained in:
parent
09207b3977
commit
e757bbba41
@ -11,10 +11,11 @@
|
|||||||
|
|
||||||
install_log=install_valence.log
|
install_log=install_valence.log
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
CURR_USER="$(whoami)"
|
||||||
|
|
||||||
cd $DIR
|
cd "$DIR"
|
||||||
echo "Current directory: $DIR" >> $install_log
|
echo "Current directory: $DIR" >> $install_log
|
||||||
if [ `whoami` != 'root' ]; then
|
if [ "$CURR_USER" != 'root' ]; then
|
||||||
echo "You must be root to install."
|
echo "You must be root to install."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@ -24,8 +25,8 @@ echo "Detected PYTHON HOME: $PYHOME" >> $install_log
|
|||||||
|
|
||||||
# Copy the config files
|
# Copy the config files
|
||||||
echo "Setting up valence config" >> $install_log
|
echo "Setting up valence config" >> $install_log
|
||||||
sed s/\${CHUID}/`whoami`/ $DIR/doc/source/init/valence.conf > /tmp/valence.conf
|
sed "s/\${CHUID}/$CURR_USER/" "$DIR"/doc/source/init/valence.conf > /tmp/valence.conf
|
||||||
#Use alternate sed delimiter because path will have /
|
# Use alternate sed delimiter because path will have /
|
||||||
sed -i "s#PYHOME#$PYHOME#" /tmp/valence.conf
|
sed -i "s#PYHOME#$PYHOME#" /tmp/valence.conf
|
||||||
mv /tmp/valence.conf /etc/init/valence.conf
|
mv /tmp/valence.conf /etc/init/valence.conf
|
||||||
|
|
||||||
@ -33,14 +34,14 @@ mv /tmp/valence.conf /etc/init/valence.conf
|
|||||||
if [ ! -d "/etc/valence" ]; then
|
if [ ! -d "/etc/valence" ]; then
|
||||||
mkdir /etc/valence
|
mkdir /etc/valence
|
||||||
fi
|
fi
|
||||||
chown `whoami`:`whoami` /etc/valence
|
chown "$CURR_USER":"$CURR_USER" /etc/valence
|
||||||
cp etc/valence/valence.conf.sample /etc/valence/valence.conf
|
cp etc/valence/valence.conf.sample /etc/valence/valence.conf
|
||||||
|
|
||||||
# create log directory for valence if it doesn't exist
|
# create log directory for valence if it doesn't exist
|
||||||
if [ ! -d "/var/log/valence" ]; then
|
if [ ! -d "/var/log/valence" ]; then
|
||||||
mkdir /var/log/valence
|
mkdir /var/log/valence
|
||||||
fi
|
fi
|
||||||
chown `whoami`:`whoami` /var/log/valence
|
chown "$CURR_USER":"$CURR_USER" /var/log/valence
|
||||||
|
|
||||||
echo "Installing dependencies from requirements.txt" >> $install_log
|
echo "Installing dependencies from requirements.txt" >> $install_log
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user