mirror of
https://github.com/Fluent-networks/tailscale-mikrotik.git
synced 2025-08-02 17:14:57 +02:00
Initial commit
This commit is contained in:
parent
9f8283cafc
commit
ce3f24ee3d
4 changed files with 250 additions and 2 deletions
29
tailscale.sh
Executable file
29
tailscale.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prepare run dir
|
||||
if [ ! -d "/var/run/sshd" ]; then
|
||||
mkdir -p /var/run/sshd
|
||||
fi
|
||||
|
||||
set -m
|
||||
|
||||
# Install routes
|
||||
IFS=',' read -ra SUBNETS <<< "${ADVERTISE_ROUTES}"
|
||||
for s in "${SUBNETS[@]}"; do
|
||||
ip route add "$s" via "${CONTAINER_GATEWAY}"
|
||||
done
|
||||
|
||||
# Start tailscaled and bring tailscale up
|
||||
/usr/local/bin/tailscaled --tun=userspace-networking &
|
||||
until /usr/local/bin/tailscale up \
|
||||
--authkey=${AUTH_KEY} \
|
||||
--advertise-routes="${ADVERTISE_ROUTES}"
|
||||
do
|
||||
sleep 0.1
|
||||
done
|
||||
echo Tailscale started
|
||||
|
||||
# Start SSH
|
||||
/usr/sbin/sshd -D
|
||||
|
||||
fg %1
|
Loading…
Add table
Add a link
Reference in a new issue