summaryrefslogtreecommitdiffhomepage
path: root/scripts/installer.sh
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2021-05-15 14:41:02 -0400
committerChristine Dodrill <xe@tailscale.com>2021-05-26 13:00:01 -0400
commited69ae4684137e7baca581f1cdece02e32f43c67 (patch)
tree0d0c4fd22a0b6e5cd693384c5aa61ce969c62df3 /scripts/installer.sh
parent4f92f405eeaf2c6d9dffab74a0e38095213b69b7 (diff)
downloadtailscale-Xe/test-install-script-libvirtd.tar.xz
tailscale-Xe/test-install-script-libvirtd.zip
scripts/installer: support all distros and osesXe/test-install-script-libvirtd
As well function entirely headlessly. This was used to test the work done in #1922. The only thing it fails on is Debian bullseye, which will need more work due to it being prerelase. More work is required there but that is out of scope for now. Signed-off-by: Christine Dodrill <me@christine.website>
Diffstat (limited to 'scripts/installer.sh')
-rwxr-xr-xscripts/installer.sh43
1 files changed, 29 insertions, 14 deletions
diff --git a/scripts/installer.sh b/scripts/installer.sh
index dbeb4aa92..0d38ea4fc 100755
--- a/scripts/installer.sh
+++ b/scripts/installer.sh
@@ -8,6 +8,8 @@
set -eu
+RELEASE="${TAILSCALE_RELEASE:-stable}"
+
# All the code is wrapped in a main function that gets called at the
# bottom of the file, so that a truncated partial download doesn't end
# up executing half a script.
@@ -91,7 +93,7 @@ main() {
;;
alpine)
OS="$ID"
- VERSION="$VERSION_ID"
+ VERSION="$(echo $PRETTY_NAME | cut -d' ' -f3)"
PACKAGETYPE="apk"
;;
nixos)
@@ -182,6 +184,10 @@ main() {
OS_UNSUPPORTED=1
fi
;;
+ fedora)
+ # We support every fedora release currently in use.
+ # No checking needed.
+ ;;
centos)
if [ "$VERSION" != "7" ] && \
[ "$VERSION" != "8" ]
@@ -216,8 +222,10 @@ main() {
# Rolling release, no version checking needed.
;;
alpine)
- # All versions supported, no version checking needed.
- # TODO: is that true? When was tailscale packaged?
+ if [ "$VERSION" != "edge" ]
+ then
+ OS_UNSUPPORTED=1
+ fi
;;
void)
# Rolling release, no version checking needed.
@@ -325,38 +333,39 @@ main() {
# TODO: use newfangled per-repo signature scheme
set -x
- $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
+ $CURL "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION.gpg" | $SUDO apt-key add -
+ $CURL "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list
$SUDO apt-get update
$SUDO apt-get install tailscale
set +x
;;
yum)
set -x
- $SUDO yum install yum-utils
- $SUDO yum-config-manager --add-repo "https://pkgs.tailscale.com/stable/$OS/$VERSION/tailscale.repo"
- $SUDO yum install tailscale
+ $SUDO yum install -y yum-utils
+ $SUDO yum-config-manager --add-repo "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/tailscale.repo"
+ $SUDO yum install -y tailscale
$SUDO systemctl enable --now tailscaled
set +x
;;
dnf)
set -x
- $SUDO dnf config-manager --add-repo "https://pkgs.tailscale.com/stable/$OS/$VERSION/tailscale.repo"
- $SUDO dnf install tailscale
+ $SUDO dnf config-manager --add-repo "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/tailscale.repo"
+ $SUDO dnf install -y tailscale
$SUDO systemctl enable --now tailscaled
set +x
;;
zypper)
set -x
- $SUDO zypper ar -g -r "https://pkgs.tailscale.com/stable/$OS/$VERSION/tailscale.repo"
- $SUDO zypper ref
- $SUDO zypper in tailscale
+ $SUDO rpm --import https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/repo.gpg
+ $SUDO zypper ar -g -r "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/tailscale.repo"
+ $SUDO zypper ref -r tailscale-stable
+ $SUDO zypper in -y tailscale
$SUDO systemctl enable --now tailscaled
set +x
;;
pacman)
set -x
- $SUDO pacman -S tailscale
+ $SUDO pacman -S --noconfirm tailscale
$SUDO systemctl enable --now tailscaled
set +x
;;
@@ -364,6 +373,7 @@ main() {
set -x
$SUDO apk add tailscale
$SUDO rc-update add tailscale
+ $SUDO service tailscale start
set +x
;;
xbps)
@@ -381,6 +391,11 @@ main() {
open "https://apps.apple.com/us/app/tailscale/id1475387142"
set +x
;;
+ pkg)
+ set -x
+ $SUDO pkg install -y tailscale
+ set +x
+ ;;
*)
echo "unexpected: unknown package type $PACKAGETYPE"
exit 1