From 787fc41fa48d7c944c16ae7dff6a2f70aca6474c Mon Sep 17 00:00:00 2001 From: Anton Tolchanov Date: Fri, 28 Apr 2023 13:47:03 +0100 Subject: [PATCH] scripts/installer.sh: check connectivity with pkgs.tailscale.com Installer script relies on pkgs.tailscale.com being reachable, both for checking what Linux distros are supported, but also for actually downloading repo configuration files, gpg keys and packages themselves. This change adds a simple reachability check which will print an error message when pkgs.tailscale.com is not reachable. Fixes https://github.com/tailscale/corp/issues/8952 Signed-off-by: Anton Tolchanov --- scripts/installer.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/installer.sh b/scripts/installer.sh index 7f4ff7e9b..86649bfdb 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -321,6 +321,17 @@ main() { exit 1 fi + TEST_URL="https://pkgs.tailscale.com/" + RC=0 + TEST_OUT=$($CURL "$TEST_URL" 2>&1) || RC=$? + if [ $RC != 0 ]; then + echo "The installer cannot reach $TEST_URL" + echo "Please make sure that your machine has internet access." + echo "Test output:" + echo $TEST_OUT + exit 1 + fi + # Step 2: having detected an OS we support, is it one of the # versions we support? OS_UNSUPPORTED=