Script de consulta de cache activo

Tema en 'Scripting & Scheduling' comenzado por MikrotikPeru, 4 de Junio de 2017.

  1. MikrotikPeru

    MikrotikPeru Well-Known Member

    PHP:
    /tool fetch url="http://192.168.10.2/index.html" mode=http port=8080
    PHP:
    :local checkpage "index.html";
    :local found "0";
    :foreach i in=[/file find] do={
        :local filename [/file get $i name];
        if ( $filename = $checkpage) do={ :set found "1"; :log info "found"; }
    }
    :log info "$found";
    if ( $found = "0" ) do={ :log info "Disable rule, service down"; /ip fire nat dis 1 } else={ :log info "Enable rule, service up"; /ip fire nat en 1; }
    /file remove $checkpage;
     

Comparte esta página