Browse Source

Lazyloading tailscale scripts instead of softlinks.

pull/3/head
Adyanth H 1 year ago
parent
commit
a83567f365
  1. 1
      .gitignore
  2. 0
      etc/init.d/tailscale
  3. 5
      generate-tar.sh
  4. 23
      usr/bin/tailscale
  5. 19
      usr/bin/tailscaled

1
.gitignore vendored

@ -0,0 +1 @@
tailscale-enabler*.tgz

0
etc/init.d/tailscale

5
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/

23
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 "[email protected]"

19
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 "[email protected]"
Loading…
Cancel
Save