From 7a3df36ac51d7d9f7cc2f6f69f25ebf5ec141b88 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Thu, 1 Sep 2022 00:31:59 +0200 Subject: [PATCH] Fixed and improved script for installing dependencies --- docs/source/_static/install_dependencies.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/source/_static/install_dependencies.sh b/docs/source/_static/install_dependencies.sh index c2d3e1b23..149b7fc22 100755 --- a/docs/source/_static/install_dependencies.sh +++ b/docs/source/_static/install_dependencies.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +trap 'RET=$? ; echo -e >&2 "\n\x1b[31mFailed installing dependencies. Could be a bug in the installer or unsupported platform. Open a bug report over at https://github.com/luxonis/depthai - exited with status $RET at line $LINENO \x1b[0m\n" ; exit $RET' ERR readonly linux_pkgs=( python3 @@ -124,9 +124,11 @@ elif [ -f /etc/os-release ]; then python3 -m pip install --upgrade pip fi - dpkg -s uvcdynctrl > /dev/null 2>&1 + # As set -e is set, retrieve the return value without exiting + RET=0 + dpkg -s uvcdynctrl > /dev/null 2>&1 || RET=$? || true # is uvcdynctrl installed - if [ $? -eq 0 ]; then + if [[ "$RET" == "0" ]]; then echo -e "\033[33mWe detected \"uvcdynctrl\" installed on your system. \033[0m" echo -e "\033[33mWe recommend removing this package, as it creates a huge log files if a camera is used in UVC mode (webcam)\033[0m" echo -e "\033[33mYou can do so by running the following commands:\033[0m" @@ -154,7 +156,8 @@ elif [ -f /etc/os-release ]; then fi # Allow all users to read and write to Myriad X devices - echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules + echo "Installing udev rules..." + echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules > /dev/null sudo udevadm control --reload-rules && sudo udevadm trigger else echo "ERROR: Host not supported"