Skip to content

Commit

Permalink
chore: Add connection check & proxy message to sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rthorn-nr committed Feb 23, 2023
1 parent be20f51 commit 31c13c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ if [ $IS_CURL_INSTALLED -eq 0 ]; then
fi

# GitHub's URL for the latest release, will redirect.
LATEST_URL="https://download.newrelic.com/install/newrelic-cli/currentVersion.txt"
BASE_URL="https://download.newrelic.com"
LATEST_URL="$BASE_URL/install/newrelic-cli/currentVersion.txt"
DESTDIR="${DESTDIR:-/usr/local/bin}"

# Check for connectivity to https://download.newrelic.com
curl --connect-timeout 10 -IsL "$BASE_URL" > /dev/null || ( echo "Cannot connect to $BASE_URL to download the New Relic CLI. Check your firewall settings. If you are using a proxy, make sure you have set the HTTPS_PROXY environment variable." && exit 132 )

# Create DESTDIR if it does not exist.
if [ ! -d "$DESTDIR" ]; then
mkdir -m 755 -p "$DESTDIR"
Expand Down

0 comments on commit 31c13c8

Please sign in to comment.