Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save neurocis/5ff45c7a4aa1015db5eeea3f431bd51f to your computer and use it in GitHub Desktop.
Save neurocis/5ff45c7a4aa1015db5eeea3f431bd51f to your computer and use it in GitHub Desktop.
Tailscale Unraid Setup
# /boot/config/go
# add the following...
# Tailscale
bash /boot/config/tailscale/install.sh
bash /boot/config/tailscale/start.sh
#!/bin/bash
# /boot/config/tailscale/install.sh
# first time only, run:
# $ touch /boot/config/tailscale/tailscaled.state
mkdir -p /var/lib/tailscale
tar -xf /boot/config/tailscale/tailscale_static.tgz -C /usr/bin/ --strip-components=1 --no-anchored tailscale
tar -xf /boot/config/tailscale/tailscale_static.tgz -C /usr/sbin/ --strip-components=1 --no-anchored tailscaled
ln -sf /boot/config/tailscale/tailscaled.state /var/lib/tailscale/tailscaled.state
#!/bin/bash
# /boot/config/tailscale/start.sh
/usr/sbin/tailscaled -cleanup
screen -A -m -d -S tailscaled /usr/sbin/tailscaled -state=/boot/config/tailscale/tailscaled.state > /var/log/tailscale.log 2>&1 &
#!/bin/bash
# add the following script using the Unraid "User Scripts" plugin
# requires "screen" to be installed (via the Nerd Pack plugin)
set -x
# check latest version against what's installed
VER=$(curl -sL https://api.github.com/repos/tailscale/tailscale/releases/latest | jq -r ".tag_name" | cut -c 2-)
if [ "$VER" = "$(tailscale version | head -n1)" ]; then
echo "$VER already installed, exiting..."
exit 0
fi
# download latest version, restart daemon
curl -fsSL -o /boot/config/tailscale/tailscale_static.tgz "https://pkgs.tailscale.com/stable/tailscale_${VER}_amd64.tgz"
if [ $? -eq 0 ]; then
screen -X -S tailscaled quit
/usr/sbin/tailscaled -cleanup
bash /boot/config/tailscale/install.sh
bash /boot/config/tailscale/start.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment