#!/bin/sh set -e mkdir -p ~/.cache/gots/ cd ~/.cache/gots/ ARCH=$(uname -m) case "$ARCH" in i*86) ARCH="386" ;; x86_64) ARCH="amd64" ;; arm*l) ARCH="arm" ;; esac FILE=$(curl -sL https://pkgs.tailscale.com/stable/ | sed 's@.*href="@@; s@".*@@' | grep "_$ARCH.tgz" ) curl -s "https://pkgs.tailscale.com/stable/$FILE" | tar zx --strip-components=1 LOGIN=$(sudo -n -b sh -c " ./tailscaled --state=mem: -no-logs-no-support >/dev/null >/dev/null 2>/dev/null ./tailscale up --operator=$USER ") echo $LOGIN