forked from compujuckel/adsb-docker
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for wingbits-cli with geosigner dongle
- Loading branch information
Showing
1 changed file
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,51 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
arch="$(dpkg --print-architecture)" | ||
echo System Architecture: $arch | ||
function setup_wingbits_client() { | ||
case "$(uname -s)" in | ||
Linux) | ||
GOOS="linux" | ||
;; | ||
Darwin) | ||
GOOS="darwin" | ||
;; | ||
*) | ||
echo "Unsupported OS" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
cd /tmp | ||
# Determine the architecture | ||
case "$(uname -m)" in | ||
x86_64) | ||
GOARCH="amd64" | ||
;; | ||
i386|i686) | ||
GOARCH="386" | ||
;; | ||
armv7l) | ||
GOARCH="arm" | ||
;; | ||
aarch64|arm64) | ||
GOARCH="arm64" | ||
;; | ||
*) | ||
echo "Unsupported architecture" | ||
exit 1 | ||
;; | ||
esac | ||
WINGBITS_PATH="/etc/wingbits" | ||
echo "Architecture: $GOOS-$GOARCH" | ||
mkdir -p $WINGBITS_PATH | ||
curl -o latest.json "https://install.wingbits.com/$GOOS-$GOARCH.json" | ||
version=$(grep -o '"Version": "[^"]*"' latest.json | cut -d'"' -f4) | ||
curl -o $WINGBITS_PATH/wingbits.gz "https://install.wingbits.com/$version/$GOOS-$GOARCH.gz" | ||
rm $WINGBITS_PATH/wingbits | ||
gunzip $WINGBITS_PATH/wingbits.gz | ||
chmod +x $WINGBITS_PATH/wingbits | ||
curl -o $WINGBITS_PATH/config.json "https://install.wingbits.com/config.json" | ||
curl -o /lib/systemd/system/wingbits.service "https://install.wingbits.com/wingbits.service" | ||
sed -i -e "s/STATION_ID/$device_id/" $WINGBITS_PATH/config.json | ||
} | ||
|
||
bash -c "$(curl -L https://setup.vector.dev)" | ||
apt-get -y install vector | ||
setup_wingbits_client |