diff --git a/src/install/common.py b/src/install/common.py index 8219865b3..b1208f53c 100644 --- a/src/install/common.py +++ b/src/install/common.py @@ -20,7 +20,7 @@ def install_pip(python_command): raise InstallationError('Error in pip installation for {}:\n{}'.format(python_command, output)) -def main(distribution): +def main(distribution): # pylint: disable=too-many-statements xenial = distribution == 'xenial' apt_install_packages('apt-transport-https') @@ -62,7 +62,7 @@ def main(distribution): # install general python dependencys apt_install_packages('libmagic-dev') - apt_install_packages('libffi-dev', 'libfuzzy-dev') + apt_install_packages('libfuzzy-dev') pip3_install_packages('git+https://github.com/fkie-cad/fact_helper_file.git') pip3_install_packages('psutil') pip3_install_packages('pytest==3.5.1', 'pytest-cov', 'pytest-pep8', 'pylint', 'python-magic', 'xmltodict', 'yara-python==3.7.0', 'appdirs') diff --git a/src/install/pre_install.sh b/src/install/pre_install.sh index d2f6c707e..21aa7eafa 100755 --- a/src/install/pre_install.sh +++ b/src/install/pre_install.sh @@ -3,17 +3,17 @@ FACTUSER=$(whoami) CODENAME=$(lsb_release -cs) -if [ ${CODENAME} = 'tara' -o ${CODENAME} = 'tessa' ]; then +if [ "${CODENAME}" = "tara" ] || [ "${CODENAME}" = "tessa" ]; then CODENAME=bionic -elif [ ${CODENAME} = 'sarah' -o ${CODENAME} = 'serena' -o ${CODENAME} = 'sonya' -o ${CODENAME} = 'sylvia' ]; then +elif [ "${CODENAME}" = "sarah" ] || [ "${CODENAME}" = "serena" ] || [ "${CODENAME}" = "sonya" ] || [ "${CODENAME}" = "sylvia" ]; then CODENAME=xenial -elif [ ${CODENAME} = 'rebecca' -o ${CODENAME} = 'rafaela' -o ${CODENAME} = 'rosa' ]; then +elif [ "${CODENAME}" = "rebecca" ] || [ "${CODENAME}" = "rafaela" ] || [ "${CODENAME}" = "rosa" ]; then CODENAME=trusty - sudo apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual + sudo apt-get -y install "linux-image-extra-$(uname -r)" linux-image-extra-virtual fi echo "Install Pre-Install Requirements" -sudo apt-get -y install python3-pip git +sudo apt-get -y install python3-pip git libffi-dev echo "Installing Docker" @@ -37,11 +37,11 @@ sudo apt-get -y install docker-ce sudo systemctl enable docker # add fact-user to docker group -if [ ! $(getent group "docker") ] +if [ ! "$(getent group docker)" ] then sudo groupadd docker fi -sudo usermod -aG docker $FACTUSER +sudo usermod -aG docker "$FACTUSER" sudo -EH pip3 install --upgrade docker-compose