summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Anderson <danderson@tailscale.com>2021-05-14 14:11:50 -0700
committerDavid Anderson <danderson@tailscale.com>2021-05-14 14:12:31 -0700
commit0e9ea9f7794748018ef724df2f26645e9c619b4f (patch)
tree5edc4202164b0974bba5c1203f951c4e1b2e7f93
parent783f125003766c11e45589c3873fc5ed53b06d48 (diff)
downloadtailscale-0e9ea9f7794748018ef724df2f26645e9c619b4f.tar.xz
tailscale-0e9ea9f7794748018ef724df2f26645e9c619b4f.zip
scripts: detect curl vs. wget and use the right one.
Signed-off-by: David Anderson <danderson@tailscale.com>
-rwxr-xr-xscripts/installer.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/installer.sh b/scripts/installer.sh
index 3b1a460d8..0249d0456 100755
--- a/scripts/installer.sh
+++ b/scripts/installer.sh
@@ -304,14 +304,27 @@ main() {
exit 1
fi
+
# Step 3: run the installation.
echo "Installing Tailscale for $OS $VERSION, using method $PACKAGETYPE"
case "$PACKAGETYPE" in
apt)
+ CURL=
+ if type curl >/dev/null; then
+ CURL="curl -fsSL"
+ elif type wget >/dev/null; then
+ CURL="wget -q -O-"
+ fi
+ if [ -z "$CURL" ]; then
+ echo "The installer needs either curl or wget to download files."
+ echo "Please install either curl or wget to proceed."
+ exit 1
+ fi
+
# TODO: use newfangled per-repo signature scheme
set -x
- curl -fsSL "https://pkgs.tailscale.com/stable/$OS/$VERSION.gpg" | $SUDO apt-key add -
- curl -fsSL "https://pkgs.tailscale.com/stable/$OS/$VERSION.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list
+ $CURL "https://pkgs.tailscale.com/stable/$OS/$VERSION.gpg" | $SUDO apt-key add -
+ $CURL "https://pkgs.tailscale.com/stable/$OS/$VERSION.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list
$SUDO apt-get update
$SUDO apt-get install tailscale
set +x