File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2+ # GitHub token for downloading artifacts, no perms given
3+ GITHUB_TOKEN=" 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"
24
35ARCH=$( uname -m)
46IS_PI_ZERO=false
@@ -11,22 +13,30 @@ if [ -f /sys/firmware/devicetree/base/model ]; then
1113fi
1214
1315if [ " $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
2938else
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
You can’t perform that action at this time.
0 commit comments