#!/bin/bash # Determine the OS (GOOS) and architecture (GOARCH) GOOS=$(uname -s | tr '[:upper:]' '[:lower:]') GOARCH=$(uname -m) # Map uname -m results to GOARCH case "$GOARCH" in x86_64) GOARCH="amd64" ;; armv7l) GOARCH="arm" ;; arm64) GOARCH="arm64" ;; *) echo "Unsupported architecture: $GOARCH" exit 1 ;; esac # Check if OS is supported if [[ "$GOOS" != "linux" && "$GOOS" != "darwin" && "$GOOS" != "windows" ]]; then echo "Unsupported OS: $GOOS" exit 1 fi # Adjust filename for Windows if [ "$GOOS" == "windows" ]; then FILENAME="plugis3.exe" else FILENAME="plugis3" fi # Base URL for downloading BASE_URL="https://get.plugis.cloud" # Construct the full URL for the binary and its md5 checksum DOWNLOAD_URL="$BASE_URL/$GOOS/$GOARCH/$FILENAME" MD5_URL="$BASE_URL/$GOOS/$GOARCH/$FILENAME.md5" # Download the binary echo "Downloading $FILENAME from $DOWNLOAD_URL..." curl -L -o "$FILENAME" "$DOWNLOAD_URL" if [ $? -ne 0 ]; then echo "Failed to download $FILENAME." exit 1 fi echo "$FILENAME downloaded successfully." chmod +x "$FILENAME" sudo ./"$FILENAME" install