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

ファイルのサイズまたは接続速度に応じて、1 時間または 10 分ごとに 1 回繰り返すスケジュールを 2 つ作成し (自由に設定できます)、開始時間を 10 秒以上離します。

最初のスクリプトは、既存のファイルを削除して再ダウンロードします。

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

2 つ目は、ファイルが存在するかどうかを確認します。

: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 に答える