Commit 56103680 authored by Philippe Gauron's avatar Philippe Gauron
Browse files

correction analyse statique shellcheck

parent a99ee62d
......@@ -11,17 +11,20 @@ set +e
## Set to 1 to print every message
DEBUG=1
cd $(dirname "$0")
cd "$(dirname "$0")" || { echo "failure: cd $(dirname "$0")" ; exit 0; }
REPO_DIR=$(pwd)/
## Getting printing functions
# shellcheck source=utils.sh
source "${REPO_DIR}/utils.sh"
## Getting global variables
# shellcheck source=globals.sh
source "${REPO_DIR}/globals.sh"
## Getting installation settings
# shellcheck source=installation_parameters.sh
source "${REPO_DIR}/installation_parameters.sh"
## Sourcing /etc/tangorc
......@@ -82,7 +85,7 @@ fi
## global variable definition
CORRECT_TANGO_HOST="srv-2.thomx.fr:20000"
ERROR=0
# shellcheck disable=SC2034 # indexed arrays
typeset -a PAQUETS_PIP PAQUETS_VERSION
## pip packages
PIP_PACKAGES_NUMBER=4
......@@ -242,7 +245,7 @@ then
if [[ "${TANGOTEST_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts TangoTest device for instance test
/usr/lib/tango/TangoTest test & > /dev/null
{ /usr/lib/tango/TangoTest test &> /dev/null & }
sleep 1
TANGOTEST_DEVICE_UNREACHABLE2=1
/usr/lib/tango/tango_admin --ping-device sys/tg_test/1 && TANGOTEST_DEVICE_UNREACHABLE2=0
......@@ -299,8 +302,8 @@ then
for package in ${DEBIAN_PACKAGES_CLIENT}
do
DEBIAN_PACKAGE_NOT_INSTALLED=1
$(dpkg -l | grep ^ii | grep "${package} " > /dev/null) && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "$?" -ne 0 ]]
dpkg -l | grep ^ii | grep "${package} " > /dev/null && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "${DEBIAN_PACKAGE_NOT_INSTALLED}" -ne 0 ]]
then
warning "debian package ${package} is not installed"
else
......@@ -391,7 +394,7 @@ then
if [[ "${HDBARCHIVER_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts HdbArchiver device for instance 01
/opt/ArchivingRoot/device/linux/HdbArchiver 01 & > /dev/null
/opt/ArchivingRoot/device/linux/HdbArchiver 01 &> /dev/null &
sleep 3
HDBARCHIVER_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/hdb/hdbarchiver.01 && HDBARCHIVER_DEVICE_UNREACHABLE=0
......@@ -446,7 +449,7 @@ then
if [[ "${HDBEXTRACTOR_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts HdbExtractor device for instance 01
/opt/ArchivingRoot/device/linux/HdbExtractor 01 & > /dev/null
/opt/ArchivingRoot/device/linux/HdbExtractor 01 &> /dev/null &
sleep 3
HDBEXTRACTOR_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/hdb/hdbextractor.01 && HDBEXTRACTOR_DEVICE_UNREACHABLE=0
......@@ -501,7 +504,7 @@ then
if [[ "${TDBARCHIVER_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts TdbArchiver device for instance 01
/opt/ArchivingRoot/device/linux/TdbArchiver 01 & > /dev/null
/opt/ArchivingRoot/device/linux/TdbArchiver 01 &> /dev/null &
sleep 3
TDBARCHIVER_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/tdb/tdbarchiver.01 && TDBARCHIVER_DEVICE_UNREACHABLE=0
......@@ -556,7 +559,7 @@ then
if [[ "${TDBEXTRACTOR_DEVICE_UNREACHABLE}" -ne 0 ]]
then
## starts TdbExtractor device for instance 01
/opt/ArchivingRoot/device/linux/TdbExtractor 01 & > /dev/null
/opt/ArchivingRoot/device/linux/TdbExtractor 01 &> /dev/null &
sleep 3
TDBEXTRACTOR_DEVICE_UNREACHABLE=1
/usr/lib/tango/tango_admin --ping-device archiving/tdb/tdbextractor.01 && TDBEXTRACTOR_DEVICE_UNREACHABLE=0
......@@ -581,7 +584,6 @@ fi
### TANGO_HOST
source /etc/tangorc
if [[ "${TANGO_HOST}" == "${CORRECT_TANGO_HOST}" ]]
then
if [[ "${DEBUG}" -eq 1 ]]
......@@ -605,7 +607,6 @@ fi
if [[ ! $(python -V 2>&1) == "Python 2.7"* ]]
then
warning "Python is not installed in version 2.7"
ERREUR=2
else
if [[ "${DEBUG}" -eq 1 ]]
then
......@@ -616,7 +617,7 @@ fi
## Check package installation of packages needed for taurus
## fandango==13.9.0 taurus==4.4.0 PyYAML==3.13 QtPy==1.2.1 python-qt4 python-qwt5-qt4 python-qtpy qt4-designer pyqt4-dev-tools
for ((package=0;package<${PIP_PACKAGES_NUMBER}; package++))
for ((package=0; package<PIP_PACKAGES_NUMBER; package++))
do
PIP_PACKAGE_NOT_INSTALLED=1
PIP_COMMAND=$(pip show "${PIP_PACKAGES[$package]}") && PIP_PACKAGE_NOT_INSTALLED=0
......@@ -642,8 +643,8 @@ done
for package in ${DEBIAN_PACKAGES}
do
DEBIAN_PACKAGE_NOT_INSTALLED=1
$(dpkg -l | grep ^ii | grep "${package} " > /dev/null) && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "$?" -ne 0 ]]
dpkg -l | grep ^ii | grep "${package} " > /dev/null && DEBIAN_PACKAGE_NOT_INSTALLED=0
if [[ "${DEBIAN_PACKAGE_NOT_INSTALLED}" -ne 0 ]]
then
warning "debian package ${package} is not installed"
else
......
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