-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux-setup.sh
More file actions
executable file
·32 lines (27 loc) · 832 Bytes
/
linux-setup.sh
File metadata and controls
executable file
·32 lines (27 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
#
# Downloads needed programs and installs them. Copies udev rules and makes
# sure PATH and directories are setup correctly.
#
# @author lowdrant
set -o nounset pipefail errexit
# copy udev rules
sudo cp 99-psEye.rules /etc/udev/rules.d
sudo udevadm control --reload-rules && sudo udevadm trigger
# python libs
sudo apt install -y python3-opencv python3-numpy python3-yaml
# add pseyepath
fdir="$(dirname $(realpath $0))"
tgtpath="$fdir/CalibratePSEye"
grep "$tgtpath" <<< "$PYTHONPATH"
if [ ! $? -eq 0 ]
then
echo "INFO: CalibratePSEye is not in your PYTHONPATH. Adding to .profile..."
echo "PSEYEPATH=$tgtpath" >> "$HOME/.profile"
echo 'export PYTHONPATH=$PYTHONPATH:$PSEYEPATH' >> "$HOME/.profile" # want '$'
fi
# add data directory
if [ ! -e "$fdir/data" ]
then
mkdir "$fdir/data"
fi