diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..15adf8b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tailscale-enabler*.tgz diff --git a/etc/init.d/tailscale b/etc/init.d/tailscale old mode 100644 new mode 100755 diff --git a/generate-tar.sh b/generate-tar.sh new file mode 100755 index 0000000..ec41510 --- /dev/null +++ b/generate-tar.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Falls back to busybox tar syntax if running on openwrt busybox tar rather than GNU tar +filename="tailscale-enabler-$(git rev-parse HEAD | cut -c1-5).tgz" +tar -czvf $filename usr/ etc/ || tar c -zvf $filename usr/ etc/ diff --git a/usr/bin/tailscale b/usr/bin/tailscale new file mode 100755 index 0000000..c1dc3b2 --- /dev/null +++ b/usr/bin/tailscale @@ -0,0 +1,23 @@ +#!/bin/sh + +version='1.2.10_mips' + +if [ ! -f /tmp/tailscale ]; then + echo "Downloading Tailscale ${version} .." + + echo -e "tailscale_${version}/tailscale" > /tmp/tailscale_${version}_files.txt + + if [ ! -f /tmp/tailscaled ]; then + echo -e "tailscale_${version}/tailscaled" >> /tmp/tailscale_${version}_files.txt + fi + + wget -O- https://pkgs.tailscale.com/stable/tailscale_${version}.tgz | tar x -zvf - -C /tmp -T /tmp/tailscale_${version}_files.txt + + mv /tmp/tailscale_$version/* /tmp + rm -rf /tmp/tailscale_${version}* + + echo "Done!" + +fi + +/tmp/tailscale "$@" diff --git a/usr/bin/tailscaled b/usr/bin/tailscaled new file mode 100755 index 0000000..da68d87 --- /dev/null +++ b/usr/bin/tailscaled @@ -0,0 +1,19 @@ +#!/bin/sh + +version='1.2.10_mips' + +if [ ! -f /tmp/tailscaled ]; then + echo "Downloading Tailscale ${version} .." + + echo -e "tailscale_${version}/tailscaled" > /tmp/tailscale_${version}_files.txt + + wget -O- https://pkgs.tailscale.com/stable/tailscale_${version}.tgz | tar x -zvf - -C /tmp -T /tmp/tailscale_${version}_files.txt + + mv /tmp/tailscale_$version/* /tmp + rm -rf /tmp/tailscale_${version}* + + echo "Done!" + +fi + +/tmp/tailscaled "$@"