#!/bin/bash set -uex BITS=$(getconf LONG_BIT) if [ "$BITS" == "32" ]; then echo "This script does not support 32 bit OS. Contact info@edgedelta.com" fi ARCH="amd64" arch_str="$(arch)" if [[ "$arch_str" == *"arm"* || "$arch_str" == *"aarch"* ]]; then echo "Using arm64 architecture" ARCH="arm64" fi UNAME=$(uname) if [ "$UNAME" == "Linux" ]; then rm -f edgedelta-linux-"$ARCH".sh curl -O https://release.edgedelta.com/v0.1.18/edgedelta-linux-"$ARCH".sh chmod +x edgedelta-linux-"$ARCH".sh if [ "$UID" = "0" ]; then ED_API_KEY="$ED_API_KEY" ./edgedelta-linux-"$ARCH".sh else sudo ED_API_KEY="$ED_API_KEY" ./edgedelta-linux-"$ARCH".sh fi exit fi if [ "$UNAME" == "Darwin" ]; then rm -f edgedelta-macosx-"$ARCH".sh curl -O https://release.edgedelta.com/v0.1.18/edgedelta-macosx-"$ARCH".sh chmod +x edgedelta-macosx-"$ARCH".sh if [ "$UID" = "0" ]; then ED_API_KEY="$ED_API_KEY" ./edgedelta-macosx-"$ARCH".sh else sudo ED_API_KEY="$ED_API_KEY" ./edgedelta-macosx-"$ARCH".sh fi exit fi echo "This script does not support $UNAME OS. Contact support@edgedelta.com"