mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-16 18:08:40 +00:00
scripts/installer: support all distros and oses
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>
This commit is contained in:
parent
4f92f405ee
commit
ed69ae4684
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
RELEASE="${TAILSCALE_RELEASE:-stable}"
|
||||||
|
|
||||||
# All the code is wrapped in a main function that gets called at the
|
# 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
|
# bottom of the file, so that a truncated partial download doesn't end
|
||||||
# up executing half a script.
|
# up executing half a script.
|
||||||
@ -91,7 +93,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
OS="$ID"
|
OS="$ID"
|
||||||
VERSION="$VERSION_ID"
|
VERSION="$(echo $PRETTY_NAME | cut -d' ' -f3)"
|
||||||
PACKAGETYPE="apk"
|
PACKAGETYPE="apk"
|
||||||
;;
|
;;
|
||||||
nixos)
|
nixos)
|
||||||
@ -182,6 +184,10 @@ main() {
|
|||||||
OS_UNSUPPORTED=1
|
OS_UNSUPPORTED=1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
fedora)
|
||||||
|
# We support every fedora release currently in use.
|
||||||
|
# No checking needed.
|
||||||
|
;;
|
||||||
centos)
|
centos)
|
||||||
if [ "$VERSION" != "7" ] && \
|
if [ "$VERSION" != "7" ] && \
|
||||||
[ "$VERSION" != "8" ]
|
[ "$VERSION" != "8" ]
|
||||||
@ -216,8 +222,10 @@ main() {
|
|||||||
# Rolling release, no version checking needed.
|
# Rolling release, no version checking needed.
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
# All versions supported, no version checking needed.
|
if [ "$VERSION" != "edge" ]
|
||||||
# TODO: is that true? When was tailscale packaged?
|
then
|
||||||
|
OS_UNSUPPORTED=1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
void)
|
void)
|
||||||
# Rolling release, no version checking needed.
|
# Rolling release, no version checking needed.
|
||||||
@ -325,38 +333,39 @@ main() {
|
|||||||
|
|
||||||
# TODO: use newfangled per-repo signature scheme
|
# TODO: use newfangled per-repo signature scheme
|
||||||
set -x
|
set -x
|
||||||
$CURL "https://pkgs.tailscale.com/stable/$OS/$VERSION.gpg" | $SUDO apt-key add -
|
$CURL "https://pkgs.tailscale.com/$RELEASE/$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.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list
|
||||||
$SUDO apt-get update
|
$SUDO apt-get update
|
||||||
$SUDO apt-get install tailscale
|
$SUDO apt-get install tailscale
|
||||||
set +x
|
set +x
|
||||||
;;
|
;;
|
||||||
yum)
|
yum)
|
||||||
set -x
|
set -x
|
||||||
$SUDO yum install yum-utils
|
$SUDO yum install -y yum-utils
|
||||||
$SUDO yum-config-manager --add-repo "https://pkgs.tailscale.com/stable/$OS/$VERSION/tailscale.repo"
|
$SUDO yum-config-manager --add-repo "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/tailscale.repo"
|
||||||
$SUDO yum install tailscale
|
$SUDO yum install -y tailscale
|
||||||
$SUDO systemctl enable --now tailscaled
|
$SUDO systemctl enable --now tailscaled
|
||||||
set +x
|
set +x
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
set -x
|
set -x
|
||||||
$SUDO dnf config-manager --add-repo "https://pkgs.tailscale.com/stable/$OS/$VERSION/tailscale.repo"
|
$SUDO dnf config-manager --add-repo "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/tailscale.repo"
|
||||||
$SUDO dnf install tailscale
|
$SUDO dnf install -y tailscale
|
||||||
$SUDO systemctl enable --now tailscaled
|
$SUDO systemctl enable --now tailscaled
|
||||||
set +x
|
set +x
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
set -x
|
set -x
|
||||||
$SUDO zypper ar -g -r "https://pkgs.tailscale.com/stable/$OS/$VERSION/tailscale.repo"
|
$SUDO rpm --import https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/repo.gpg
|
||||||
$SUDO zypper ref
|
$SUDO zypper ar -g -r "https://pkgs.tailscale.com/$RELEASE/$OS/$VERSION/tailscale.repo"
|
||||||
$SUDO zypper in tailscale
|
$SUDO zypper ref -r tailscale-stable
|
||||||
|
$SUDO zypper in -y tailscale
|
||||||
$SUDO systemctl enable --now tailscaled
|
$SUDO systemctl enable --now tailscaled
|
||||||
set +x
|
set +x
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
set -x
|
set -x
|
||||||
$SUDO pacman -S tailscale
|
$SUDO pacman -S --noconfirm tailscale
|
||||||
$SUDO systemctl enable --now tailscaled
|
$SUDO systemctl enable --now tailscaled
|
||||||
set +x
|
set +x
|
||||||
;;
|
;;
|
||||||
@ -364,6 +373,7 @@ main() {
|
|||||||
set -x
|
set -x
|
||||||
$SUDO apk add tailscale
|
$SUDO apk add tailscale
|
||||||
$SUDO rc-update add tailscale
|
$SUDO rc-update add tailscale
|
||||||
|
$SUDO service tailscale start
|
||||||
set +x
|
set +x
|
||||||
;;
|
;;
|
||||||
xbps)
|
xbps)
|
||||||
@ -380,6 +390,11 @@ main() {
|
|||||||
set -x
|
set -x
|
||||||
open "https://apps.apple.com/us/app/tailscale/id1475387142"
|
open "https://apps.apple.com/us/app/tailscale/id1475387142"
|
||||||
set +x
|
set +x
|
||||||
|
;;
|
||||||
|
pkg)
|
||||||
|
set -x
|
||||||
|
$SUDO pkg install -y tailscale
|
||||||
|
set +x
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "unexpected: unknown package type $PACKAGETYPE"
|
echo "unexpected: unknown package type $PACKAGETYPE"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user