0

我一直在做这个脚本。脚本应该这样做:

它将从 URL 下载文件。如果它到达文件并下载它,则将路由更改为服务器 1。如果下载失败,它将更改路由到服务器 2。然后它将从路由器内存中删除该文件。

Download should be via command: /tool fetch url="" and then something like
 :if ( true ) do (/ip routing .....) 
and 
:if ( false ) do (/ip routing ....) 

我希望你能得到我,你可以帮助我创建这个脚本。

4

1 回答 1

0

制定 2 个每小时/10 分钟重复一次的时间表(由您决定),并根据文件大小或连接速度将开始时间间隔 10 秒或更长时间。

第一个脚本删除现有文件并重新下载:

/file remove index.php
/tool fetch url="http://example.com/index.php"

第二个检查文件是否存在:

:if ([/file find name=index.php]="") do={
#commands if download was not succesful and file does not exist
} else={
#commands if download was succesful and file exists
}
于 2015-11-08T22:52:06.433 回答