diff --git a/main.go b/main.go index 624119b..6da7297 100644 --- a/main.go +++ b/main.go @@ -520,79 +520,79 @@ func handleRoot(w http.ResponseWriter, r *http.Request) {
# SSH 登录 RouterOS 后执行 -/tool fetch url="%s/chnroute.rsc" mode=%s +# SSH login to RouterOS and execute +/tool fetch url="%[1]s/chnroute.rsc" mode=%[4]s /import chnroute.rsc -# 验证导入 +# Verify import /ip firewall address-list print count-only where list=chnroute
# 创建更新脚本
+ # Create update script
/system script add name=update-chnroute source={
- :log info "开始更新 CHNRoute"
+ :log info "Start updating CHNRoute"
/file remove [find name="chnroute.rsc"]
- /tool fetch url="%s/chnroute.rsc" mode=%s
+ /tool fetch url="%[1]s/chnroute.rsc" mode=%[4]s
:delay 3s
/ip firewall address-list remove [find list=chnroute]
/import chnroute.rsc
:local count [/ip firewall address-list print count-only where list=chnroute]
- :log info ("CHNRoute 更新完成,共 " . $count . " 条")
+ :log info ("CHNRoute updated: " . \$count . " entries")
}
-# 设置每周自动执行(每周日凌晨3点)
+# Set weekly auto-run (every Sunday at 3:00 AM)
/system scheduler add name=auto-update-chnroute interval=7d00:00:00 on-event="/system script run update-chnroute" start-time=03:00:00
# IPv6 路由列表导入 -/tool fetch url="%s/chnroute_v6.rsc" mode=%s +# Import IPv6 route list +/tool fetch url="%[1]s/chnroute_v6.rsc" mode=%[4]s /import chnroute_v6.rsc -# 验证导入 +# Verify import /ipv6 firewall address-list print count-only where list=chnroute6
# 创建 IPv6 更新脚本 +IPv6 自动更新脚本
++ +# Create IPv6 update script /system script add name=update-chnroute-v6 source={ - :log info "开始更新 CHNRoute IPv6" + :log info "Start updating CHNRoute IPv6" /file remove [find name="chnroute_v6.rsc"] - /tool fetch url="%s/chnroute_v6.rsc" mode=%s + /tool fetch url="%[1]s/chnroute_v6.rsc" mode=%[4]s :delay 3s /ipv6 firewall address-list remove [find list=chnroute6] /import chnroute_v6.rsc :local count [/ipv6 firewall address-list print count-only where list=chnroute6] - :log info ("CHNRoute IPv6 更新完成,共 " . $count . " 条") + :log info ("CHNRoute IPv6 updated: " . \$count . " entries") } -# 设置每周日凌晨3点自动执行 +# Set weekly auto-run (every Sunday at 3:00 AM) /system scheduler add name=auto-update-chnroute-v6 interval=7d00:00:00 on-event="/system script run update-chnroute-v6" start-time=03:00:00