diff --git a/scripts/install_dwc2.sh b/scripts/install_dwc2.sh index f3f43f2..2550b20 100644 --- a/scripts/install_dwc2.sh +++ b/scripts/install_dwc2.sh @@ -11,7 +11,7 @@ dwc2_install_routine(){ fi stop_klipper #disable octoprint service if installed - if systemctl is-enabled octoprint.service -q; then + if systemctl is-enabled octoprint.service -q &>/dev/null; then disable_octoprint_service fi install_tornado @@ -25,15 +25,19 @@ dwc2_install_routine(){ } install_tornado(){ - #check for dependencies - dep=(virtualenv) - dep_check - #execute operation - status_msg "Installing Tornado 5.1.1 ..." - cd ${HOME} - PYTHONDIR="${HOME}/klippy-env" - virtualenv ${PYTHONDIR} - ${PYTHONDIR}/bin/pip install tornado==5.1.1 && ok_msg "Tornado 5.1.1 successfully installed!" + if [ ! -d $TORNADO_DIR1 ]; then + #check for dependencies + dep=(virtualenv) + dep_check + #execute operation + status_msg "Installing Tornado 5.1.1 ..." + cd ${HOME} + PYTHONDIR="${HOME}/klippy-env" + virtualenv ${PYTHONDIR} + ${PYTHONDIR}/bin/pip install tornado==5.1.1 && ok_msg "Tornado 5.1.1 successfully installed!" + else + ok_msg "Looks like Tornado 5.1.1 is already installed! Continue..." + fi } install_dwc2fk(){ diff --git a/scripts/install_octoprint.sh b/scripts/install_octoprint.sh index 0766113..e76ce92 100755 --- a/scripts/install_octoprint.sh +++ b/scripts/install_octoprint.sh @@ -24,7 +24,7 @@ octoprint_dependencies(){ status_msg "Checking for dependencies ..." for octo_dep_pgk in "${octo_dep[@]}" do - if [[ $(dpkg-query -f'${Status}' --show $octo_dep_pgk 2>/dev/null) = *\ installed ]]; then + if [[ ! $(dpkg-query -f'${Status}' --show $octo_dep_pgk 2>/dev/null) = *\ installed ]]; then install+=($octo_dep_pgk) fi done