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

@@ -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