Commit 59986963 authored by Marcus's avatar Marcus

fix pip3 install command and beautify output

parent c242e23a
...@@ -50,8 +50,9 @@ echo "Adding user ${USER}" ...@@ -50,8 +50,9 @@ echo "Adding user ${USER}"
useradd -m ${USER} > /dev/null 2>&1 useradd -m ${USER} > /dev/null 2>&1
RV=$? RV=$?
case "$RV" in case "$RV" in
0-8) echo "Error creating user"; exit 1;; 0-8) echo " Error creating user"; exit 1;;
10-14) echo "Error creating user"; exit 1;; 9) echo " user already existed";;
10-14) echo " Error creating user"; exit 1;;
esac esac
### Install feudalClient ### Install feudalClient
...@@ -86,8 +87,11 @@ git co ${ADAPTER_BRANCH} > /dev/null 2>&1 ...@@ -86,8 +87,11 @@ git co ${ADAPTER_BRANCH} > /dev/null 2>&1
git pull > /dev/null 2>&1 git pull > /dev/null 2>&1
./setup.py sdist > /dev/null ./setup.py sdist > /dev/null
FULLNAME=`python3 setup.py --fullname` FULLNAME=`python3 setup.py --fullname`
${PIP} install dist/$FULLNAME.tar.gz > /dev/null ${PIP} install -U dist/$FULLNAME.tar.gz > /dev/null 2>&1 || {
echo -e "feudalAdapterLDF installed" echo -e"\n\n ${PIP} ${PIP_PARAMS} install dist/$FULLNAME.tar.gz => FAILED"
exit 1
}
echo -e " Done"
# => ldf_adapter is now in $PATH # => ldf_adapter is now in $PATH
...@@ -102,17 +106,19 @@ test -d ${ETC_CONFIG} || { ...@@ -102,17 +106,19 @@ test -d ${ETC_CONFIG} || {
### Install Config Files ### Install Config Files
test -e ${ETC_CONFIG}/ldf_adapter.conf || { test -e ${ETC_CONFIG}/ldf_adapter.conf || {
echo "Installing a template for ldf_adapter.conf in ${ETC_CONFIG}" test -e ${ETC_CONFIG}/ldf_adapter_template.conf || {
echo " => You need to edit this file" echo "Installing a template for ldf_adapter.conf in ${ETC_CONFIG}"
cp feudalAdapterLdf/ldf_adapter_template.conf ${ETC_CONFIG} cp feudalAdapterLdf/ldf_adapter_template.conf ${ETC_CONFIG}
}
} }
popd > /dev/null popd > /dev/null
test -e ${ETC_CONFIG}/client_config.json || { test -e ${ETC_CONFIG}/client_config.json || {
echo "Installing a template for client_config_template.json in ${ETC_CONFIG}" test -e ${ETC_CONFIG}/client_config_template.json || {
echo " => You need to edit this file" echo "Installing a template for client_config_template.json in ${ETC_CONFIG}"
cp client_config_template.json ${ETC_CONFIG} cp client_config_template.json ${ETC_CONFIG}
}
} }
test -e ${ETC_CONFIG}/environment || { test -e ${ETC_CONFIG}/environment || {
echo "Installing a template for environment in ${ETC_CONFIG}" echo "Installing a template for environment in ${ETC_CONFIG}"
...@@ -135,10 +141,10 @@ test -e ${LIB_SYSD}/${SERVICE}.service || { ...@@ -135,10 +141,10 @@ test -e ${LIB_SYSD}/${SERVICE}.service || {
cp ${SYSD_SERVICE} ${LIB_SYSD}/${SERVICE}.service cp ${SYSD_SERVICE} ${LIB_SYSD}/${SERVICE}.service
systemctl daemon-reload systemctl daemon-reload
} }
echo -e "Done\nRestarting ${SYSD_SERVICE}" echo -e " Done\nRestarting ${SYSD_SERVICE}"
systemctl enable $SERVICE systemctl enable $SERVICE > /dev/null 2>&1
systemctl restart $SERVICE systemctl restart $SERVICE
echo "Done" echo " Done"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment