forked from scriptorron/indi_pylibcamera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·50 lines (35 loc) · 1.1 KB
/
install.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/bash
set -o errexit
set -o nounset
PATH=/usr/local/bin:/usr/bin:/bin
export PATH
# indiserver might be in /usr/local
INDI_SERVER=$(which indiserver)
INDI_SERVER_BIN=$(dirname "$INDI_SERVER")
INDI_SERVER_USR=$(dirname "$INDI_SERVER_BIN")
echo "Installing required packages for indi_pylibcamera"
sudo apt-get update
sudo apt-get install \
python3-picamera2 \
python3-lxml \
python3-astropy
VERSION="$(grep -Po '^__version__ = \"\K(.*[^\"])' ${PWD}/indi_pylibcamera.py)"
echo "Creating ${INDI_SERVER_USR}/share/indi/indi_pylibcamera.xml"
sudo tee "${INDI_SERVER_USR}/share/indi/indi_pylibcamera.xml" >/dev/null <<EOL
<driversList>
<devGroup group="CCDs">
<device label="INDI pylibcamera">
<driver name="INDI pylibcamera">indi_pylibcamera</driver>
<version>${VERSION}</version>
</device>
</devGroup>
</driversList>
EOL
GIT_DIR=$(dirname "$0")
cd "$GIT_DIR"
sudo ln -nsf "${PWD}/indi_pylibcamera.py" "${INDI_SERVER_USR}/bin/indi_pylibcamera"
sudo chmod +x indi_pylibcamera.py
cd "$OLDPWD"
echo "You may now start the indiserver"
echo ""
echo " indiserver indi_pylibcamera"