Skip to content

Commit 60bedf9

Browse files
a
1 parent c5d18c4 commit 60bedf9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

install.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
# GitHub token for downloading artifacts, no perms given
3+
GITHUB_TOKEN="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"
24

35
ARCH=$(uname -m)
46
IS_PI_ZERO=false
@@ -11,22 +13,30 @@ if [ -f /sys/firmware/devicetree/base/model ]; then
1113
fi
1214

1315
if [ "$IS_PI_ZERO" = true ]; then
16+
if [ -z "$GITHUB_TOKEN" ]; then
17+
echo "Error: GITHUB_TOKEN environment variable is required to download artifacts"
18+
echo "Please set it with: export GITHUB_TOKEN=your_github_token"
19+
exit 1
20+
fi
21+
1422
echo "Detected Raspberry Pi Zero 2 W, downloading pre-compiled binary..."
1523
TEMP_DIR=$(mktemp -d)
16-
LATEST_RELEASE_URL=$(curl -s https://api.github.com/repos/smartlinuxcoder/edgezone/actions/artifacts \
24+
LATEST_RELEASE_URL=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
25+
https://api.github.com/repos/smartlinuxcoder/edgezone/actions/artifacts \
1726
| grep -o '"archive_download_url": "[^"]*' \
1827
| head -1 \
1928
| cut -d'"' -f4)
2029

2130
cd "$TEMP_DIR"
22-
curl -L -o artifact.zip "$LATEST_RELEASE_URL"
31+
curl -L -H "Authorization: token $GITHUB_TOKEN" -o artifact.zip "$LATEST_RELEASE_URL"
2332
unzip artifact.zip
2433
sudo mv edgezone-node /usr/local/bin/
2534
cd - > /dev/null
2635
rm -rf "$TEMP_DIR"
2736
sudo chmod +x /usr/local/bin/edgezone-node
2837
BINARY_PATH=/usr/local/bin/edgezone-node
2938
else
39+
3040
if ! which cargo > /dev/null 2>&1; then
3141
echo "Cargo not found. Installing Rust and Cargo..."
3242
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

0 commit comments

Comments
 (0)