diff --git a/main.go b/main.go index d3f87eb..624119b 100644 --- a/main.go +++ b/main.go @@ -563,10 +563,7 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { } # 设置每周自动执行(每周日凌晨3点) -/system scheduler add name=auto-update-chnroute \\ - interval=7d \\ - on-event="/system script run update-chnroute" \\ - start-time=03:00:00 +/system scheduler add name=auto-update-chnroute interval=7d00:00:00 on-event="/system script run update-chnroute" start-time=03:00:00

IPv6 导入脚本

@@ -579,6 +576,25 @@ func handleRoot(w http.ResponseWriter, r *http.Request) { # 验证导入 /ipv6 firewall address-list print count-only where list=chnroute6 + +

IPv6 自动更新脚本

+
+ +
# 创建 IPv6 更新脚本
+/system script add name=update-chnroute-v6 source={
+    :log info "开始更新 CHNRoute IPv6"
+    /file remove [find name="chnroute_v6.rsc"]
+    /tool fetch url="%s/chnroute_v6.rsc" mode=%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 . " 条")
+}
+
+# 设置每周日凌晨3点自动执行
+/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
+