forked from bluerobotics/BlueOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·25 lines (20 loc) · 973 Bytes
/
bootstrap.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
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status
set -e
LOCAL_BINARY_PATH="/usr/bin/mavlink-camera-manager"
ARTIFACT_PREFIX="mavlink-camera-manager"
VERSION=t3.12.9
# By default we install armv7
REMOTE_BINARY_URL="https://github.com/mavlink/mavlink-camera-manager/releases/download/${VERSION}/${ARTIFACT_PREFIX}-armv7.zip"
if [[ "$(uname -m)" == "x86_64"* ]]; then
REMOTE_BINARY_URL="https://github.com/mavlink/mavlink-camera-manager/releases/download/${VERSION}/${ARTIFACT_PREFIX}-linux-desktop.zip"
fi
# Download and install the camera manager under user binary folder with the correct permissions
ARTIFACT_PREFIX="mavlink-camera-manager"
wget "$REMOTE_BINARY_URL" -O "${ARTIFACT_PREFIX}.zip"
unzip "${ARTIFACT_PREFIX}.zip" -d "${ARTIFACT_PREFIX}"
# Binary
cp "${ARTIFACT_PREFIX}/${ARTIFACT_PREFIX}"* "$LOCAL_BINARY_PATH"
chmod +x "$LOCAL_BINARY_PATH"
# Remove temporary files
rm -rf "${ARTIFACT_PREFIX}.zip" "${ARTIFACT_PREFIX}"