Skip to content

Commit

Permalink
Wingbits cli prep
Browse files Browse the repository at this point in the history
Prepare for wingbits-cli with geosigner dongle
  • Loading branch information
shawaj authored Nov 19, 2024
1 parent c35c93f commit 1fc2702
Showing 1 changed file with 46 additions and 5 deletions.
51 changes: 46 additions & 5 deletions wingbits/wingbits_installer.sh
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

0 comments on commit 1fc2702

Please sign in to comment.