- Have your TV rooted
- Open Terminal with SSH client or dev-manager-desktop
- Run
curl -fsSL https://gist.githubusercontent.com/mariotaku/f7228c5459fc7ad2172a2b69dd51a4eb/raw/webosbrew-install-tailscale.sh | shand wait for it to finish
-
-
Save mpalet/3694ec89f48c403282b80a7e8167c6a7 to your computer and use it in GitHub Desktop.
Install tailscale on webOS TV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Quit if not running as root | |
| if [ "$(id -u)" -ne 0 ]; then | |
| echo "This script must be run as root. Refer to https://www.webosbrew.org/guides/rooting/ for more information." | |
| exit 1 | |
| fi | |
| # Quit if not running on webOS | |
| if [ ! -f /etc/starfish-release ]; then | |
| echo "This script is intended for webOS devices only." | |
| exit 1 | |
| fi | |
| TAILSCALE_DIST=tailscale_1.82.0_arm | |
| TAILSCALE_TARBALL="https://pkgs.tailscale.com/stable/${TAILSCALE_DIST}.tgz" | |
| INSTALL_BINDIR=/media/developer/bin/ | |
| mkdir -p "$INSTALL_BINDIR" | |
| echo "Downloading Tailscale..." | |
| curl -sSL $TAILSCALE_TARBALL | tar -xz -C $INSTALL_BINDIR \ | |
| $TAILSCALE_DIST/tailscaled \ | |
| $TAILSCALE_DIST/tailscale \ | |
| --strip-components=1 | |
| echo "Adding tailscaled to init.d..." | |
| cat <<'EOF' > /var/lib/webosbrew/init.d/tailscaled | |
| #!/bin/sh | |
| export PATH=/media/developer/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
| # Make /etc/resolv.conf writable with bind-mount | |
| cp /etc/resolv.conf /tmp/resolv.conf | |
| mount -o bind /tmp/resolv.conf /etc/resolv.conf | |
| # Start tailscaled | |
| /media/developer/bin/tailscaled &> /tmp/tailscaled.log & | |
| sleep 10 # wait for tailscaled to be ready | |
| # --- Write resolv.conf with dynamic search domain --- | |
| MAGICDNS=$(tailscale status --json | grep -o '"MagicDNSSuffix":[^,]*' | cut -d'"' -f4 | head -1) | |
| truncate -s 0 /etc/resolv.conf | |
| { | |
| echo "nameserver 100.100.100.100" | |
| echo "nameserver 127.0.0.1" | |
| echo "search $MAGICDNS" | |
| } > /etc/resolv.conf | |
| EOF | |
| chmod +x /var/lib/webosbrew/init.d/tailscaled | |
| echo "Setting up PATH..." | |
| if ! grep -q "$INSTALL_BINDIR" /home/root/.profile; then | |
| echo "export PATH=\$PATH:$INSTALL_BINDIR" >> /home/root/.profile | |
| fi | |
| echo "Done! Reboot the TV with reboot command, and run tailscale command for usage." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment