RouterOS 实用脚本
2022-11-10 12:21:30

更新 WireGuard peer 地址。

1
2
:global ip [:resolve vpn.example.com]
/interface/wireguard/peers/set endpoint-address=$ip [find where comment="test"]

获取公网 IP。

1
2
:global ip [([/tool/fetch "http://myip.dnsomatic.com/" output=user as-value]->"data")]
:put $ip

获取网页 response body。

1
2
:global result [([/tool/fetch "http://example.com" output=user as-value]->"data")]
:put $result
Prev
2022-11-10 12:21:30
Next