scripts/installer.sh: add support to use the unstable track.

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali 2022-01-12 13:22:01 -08:00 committed by Maisem Ali
parent 9e8a432146
commit 26d4ccb816

View File

@ -25,6 +25,16 @@ main() {
PACKAGETYPE="" PACKAGETYPE=""
APT_KEY_TYPE="" # Only for apt-based distros APT_KEY_TYPE="" # Only for apt-based distros
APT_SYSTEMCTL_START=false # Only needs to be true for Kali APT_SYSTEMCTL_START=false # Only needs to be true for Kali
TRACK="${TRACK:-stable}"
case "$TRACK" in
stable|unstable)
;;
*)
echo "unsupported track $TRACK"
exit 1
;;
esac
if [ -f /etc/os-release ]; then if [ -f /etc/os-release ]; then
# /etc/os-release populates a number of shell variables. We care about the following: # /etc/os-release populates a number of shell variables. We care about the following:
@ -318,7 +328,7 @@ main() {
other-linux) other-linux)
echo "Couldn't determine what kind of Linux is running." echo "Couldn't determine what kind of Linux is running."
echo "You could try the static binaries at:" echo "You could try the static binaries at:"
echo "https://pkgs.tailscale.com/stable/#static" echo "https://pkgs.tailscale.com/$TRACK/#static"
;; ;;
"") "")
echo "Couldn't determine what operating system you're running." echo "Couldn't determine what operating system you're running."
@ -398,12 +408,12 @@ main() {
$SUDO mkdir -p --mode=0755 /usr/share/keyrings $SUDO mkdir -p --mode=0755 /usr/share/keyrings
case "$APT_KEY_TYPE" in case "$APT_KEY_TYPE" in
legacy) legacy)
$CURL "https://pkgs.tailscale.com/stable/$OS/$VERSION.asc" | $SUDO apt-key add - $CURL "https://pkgs.tailscale.com/$TRACK/$OS/$VERSION.asc" | $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/$TRACK/$OS/$VERSION.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list
;; ;;
keyring) keyring)
$CURL "https://pkgs.tailscale.com/stable/$OS/$VERSION.noarmor.gpg" | $SUDO tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null $CURL "https://pkgs.tailscale.com/$TRACK/$OS/$VERSION.noarmor.gpg" | $SUDO tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
$CURL "https://pkgs.tailscale.com/stable/$OS/$VERSION.tailscale-keyring.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list $CURL "https://pkgs.tailscale.com/$TRACK/$OS/$VERSION.tailscale-keyring.list" | $SUDO tee /etc/apt/sources.list.d/tailscale.list
;; ;;
esac esac
$SUDO apt-get update $SUDO apt-get update
@ -417,21 +427,21 @@ main() {
yum) yum)
set -x set -x
$SUDO yum install yum-utils $SUDO yum install 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/$TRACK/$OS/$VERSION/tailscale.repo"
$SUDO yum install tailscale $SUDO yum install 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/$TRACK/$OS/$VERSION/tailscale.repo"
$SUDO dnf install -y 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 zypper ar -g -r "https://pkgs.tailscale.com/$TRACK/$OS/$VERSION/tailscale.repo"
$SUDO zypper ref $SUDO zypper ref
$SUDO zypper in tailscale $SUDO zypper in tailscale
$SUDO systemctl enable --now tailscaled $SUDO systemctl enable --now tailscaled