mirror of
https://github.com/videah/kobo-tailscale
synced 2026-03-20 10:41:25 +11:00
initial commit
This commit is contained in:
26
libra2/scripts/on-boot.sh
Executable file
26
libra2/scripts/on-boot.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Make sure to load the TUN kernel module and create the /dev/net/tun device
|
||||
if ! lsmod | grep -q "^tun"; then
|
||||
insmod /lib/modules/tailscale/kernel/drivers/net/tun.ko
|
||||
if [ ! -c /dev/net/tun ]; then
|
||||
mkdir -p /dev/net
|
||||
mknod /dev/net/tun c 10 200
|
||||
fi
|
||||
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 --state=/tailscaled.state &> /tailscaled.log &
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user