Rs
Rs
/system clock
set time-zone-name=America/Mexico_City
/system identity
set name=Netcom
/system ntp client
set enabled=yes primary-ntp=192.36.143.130 secondary-ntp=23.227.178.12
/system script
add dont-require-permissions=no name=ScannerEasyTicketsHistorial owner=admin \
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
source="#\r\
\n# Nombre: ScannerEasyTickets\r\
\n# Testeado: RouterOS version 6.43.12\r\
\n# Descripci\?n: Escanea Los Usuarios del Hotspot Con Su Tiempo Expira\
do Para Eliminarlos Ya Sea Corrido o Pausado Segun Su Tiempo de Expiraci\?\
n!.\r\
\n# Version: 2.0\r\
\n#\r\
\n:log info \"------Scaner EasyTickets Historial Fichas-------\"\r\
\n:foreach u in=[/ip hotspot user find where disabled=yes ] do={\r\
\n :local OU [/ip hotspot user get \$u name]\r\
\n :local LP [/ip hotspot user get \$u profile]\r\
\n\r\
\n :log info \"Removiendo Toda la Informacion de la Ficha: \$OU Con P\
lan: \$LP\"\r\
\n [ /ip hotspot user remove \$u ]\r\
\n [ /ip hotspot active remove [find where user=\$u] ]\r\
\n [ /ip hotspot cookie remove [find where user=\$u] ]\r\
\n}"
add dont-require-permissions=no name=IPsDual owner=VIP policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="#\
\_chequear las entradas al DNS\r\
\n:foreach i in=[/ip dns cache find] do={\r\
\n:local bNew \"true\";\r\
\n:local cacheName [/ip dns cache all get \$i name] ;\r\
\n# Revisar el DNS si contiene cadenas whatsapp\r\
\n:if ([:find [/ip dns cache get \$i name] \"whatsapp\"] > 0) do={\r\
\n:local tmpAddress [/ip dns cache get \$i address] ;\r\
\n#---- Si address list esta vacio, no lo chequeo ( add address directly )\
\r\
\n:if ( [/ip firewall address-list find ] = \"\") do={\r\
\n/ip firewall address-list add address=\$tmpAddress list=JO disabled=no c\
omment=\$cacheName; \r\
\n} else={\r\
\n#------- chequeo cada entrada del address-list para no repetir las ips\r\
\n:foreach j in=[/ip firewall address-list find ] do={\r\
\n#---------- set bNew variable to false if address exists in address list\
\r\
\n:if ( [/ip firewall address-list get \$j address] = \$tmpAddress ) do={\
\r\
\n:set bNew \"false\";\r\
\n}\r\
\n}\r\
\n#------- Si la direccion (IP) es nueva, la agrego al ADDRESS-LIST\r\
\n:if ( \$bNew = \"true\" ) do={\r\
\n/ip firewall address-list add address=\$tmpAddress list=JO disabled=no c\
omment=\$cacheName; \r\
\n}\r\
\n}\r\
\n}\r\
\n}\r\
\n"