Skip to content

Commit 7a3df36

Browse files
committed
Fixed and improved script for installing dependencies
1 parent 40b2682 commit 7a3df36

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/source/_static/install_dependencies.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -e
3+
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
44

55
readonly linux_pkgs=(
66
python3
@@ -124,9 +124,11 @@ elif [ -f /etc/os-release ]; then
124124
python3 -m pip install --upgrade pip
125125
fi
126126

127-
dpkg -s uvcdynctrl > /dev/null 2>&1
127+
# As set -e is set, retrieve the return value without exiting
128+
RET=0
129+
dpkg -s uvcdynctrl > /dev/null 2>&1 || RET=$? || true
128130
# is uvcdynctrl installed
129-
if [ $? -eq 0 ]; then
131+
if [[ "$RET" == "0" ]]; then
130132
echo -e "\033[33mWe detected \"uvcdynctrl\" installed on your system. \033[0m"
131133
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"
132134
echo -e "\033[33mYou can do so by running the following commands:\033[0m"
@@ -154,7 +156,8 @@ elif [ -f /etc/os-release ]; then
154156
fi
155157

156158
# Allow all users to read and write to Myriad X devices
157-
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules
159+
echo "Installing udev rules..."
160+
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules > /dev/null
158161
sudo udevadm control --reload-rules && sudo udevadm trigger
159162
else
160163
echo "ERROR: Host not supported"

0 commit comments

Comments
 (0)