set the static ip to tailscale assigned ip

This commit is contained in:
asvow
2024-01-31 16:30:50 +08:00
parent 200faabc15
commit 183cb1649c
3 changed files with 5 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ LUCI_TITLE:=LuCI for Tailscale
LUCI_DEPENDS:=+tailscale +jsonfilter +ucode
LUCI_PKGARCH:=all
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.2
include $(TOPDIR)/feeds/luci/luci.mk

View File

@@ -30,7 +30,7 @@ Tailscale is a zero config VPN for building secure networks.
```shell
opkg update
opkg install --force-overwrite luci-app-tailscale_*_all.ipk
opkg install --force-overwrite /tmp/luci-app-tailscale_*_all.ipk
```
--------------

View File

@@ -62,8 +62,11 @@ custom_instance() {
do
echo "tailscale interface $i is started!"
if [ -z "$(uci -q get network.$i)" ]; then
ts_ip=$(tailscale ip -4)
uci set network.$i=interface
uci set network.$i.proto='static'
uci set network.$i.ipaddr=$ts_ip
uci set network.$i.netmask='255.0.0.0'
uci set network.$i.device=$i
fi
done