mirror of
https://github.com/videah/kobo-tailscale
synced 2026-03-20 10:41:25 +11:00
confirm working on clara-bw as of fw 4.39.23027 / linux 4.9.77
This commit is contained in:
10
clara-bw/scripts/boot.sh
Executable file
10
clara-bw/scripts/boot.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Start by renicing ourselves to a neutral value, to avoid any mishap...
|
||||
renice 0 -p $$
|
||||
|
||||
# Launch in the background, with a clean env, after a setsid call to make very very sure udev won't kill us ;).
|
||||
env -i -- setsid /usr/local/tailscale/on-boot.sh &
|
||||
|
||||
# Done :)
|
||||
exit 0
|
||||
23
clara-bw/scripts/on-boot.sh
Executable file
23
clara-bw/scripts/on-boot.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Make sure to load the TUN kernel module and create the /dev/net/tun device
|
||||
if [ ! -c /dev/net/tun ]; then
|
||||
mkdir -p /dev/net
|
||||
mknod /dev/net/tun c 10 200
|
||||
fi
|
||||
|
||||
# Make absolutely sure that iptables is in the PATH
|
||||
export PATH=/usr/sbin:/usr/bin:$PATH
|
||||
|
||||
# Make sure /mnt/onboard is mounted
|
||||
timeout 5 sh -c "while ! grep -q /mnt/onboard /proc/mounts; do sleep 0.1; done"
|
||||
if [[ $? -eq 143 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$(pidof tailscaled | wc -w)" in
|
||||
0) tailscaled --statedir=/mnt/onboard/tailscale &> /tailscaled.log &
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
2
clara-bw/scripts/on-wlan-down.sh
Executable file
2
clara-bw/scripts/on-wlan-down.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
tailscale down
|
||||
2
clara-bw/scripts/on-wlan-up.sh
Executable file
2
clara-bw/scripts/on-wlan-up.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
tailscale up
|
||||
Reference in New Issue
Block a user