elicro a révisé ce gist . Aller à la révision
Aucun changement
elicro a révisé ce gist . Aller à la révision
1 file changed, 25 insertions
add-geoip-il-address-list-updater.rsc(fichier créé)
| @@ -0,0 +1,25 @@ | |||
| 1 | + | :do { | |
| 2 | + | :local scriptFound [:len [/system script find where name=UpdateGeoIP_IL]]; | |
| 3 | + | :local schedulerFound [:len [/system scheduler find where name=UpdateGeoIPSchedule]]; | |
| 4 | + | ||
| 5 | + | :log info "Debug step 1" | |
| 6 | + | :if ( $scriptFound = 0 ) do={ | |
| 7 | + | /system script add dont-require-permissions=no name=UpdateGeoIP_IL owner=eliezer policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="{\r\ | |
| 8 | + | \n\t:local geoipILUrl \"https://www.ngtech.co.il/geoip/geoip_il.cidr_geoip_update.rsc\";\r\ | |
| 9 | + | \n\t/tool fetch mode=https url=\$geoipILUrl;\r\ | |
| 10 | + | \n\t:delay 2s;\r\ | |
| 11 | + | \n\t/import file-name=geoip_il.cidr_geoip_update.rsc;\r\ | |
| 12 | + | \n\t:delay 20s;\r\ | |
| 13 | + | \n\t/file remove geoip_il.cidr_geoip_update.rsc;\r\ | |
| 14 | + | \n}" | |
| 15 | + | } | |
| 16 | + | :log info "Debug step 2" | |
| 17 | + | ||
| 18 | + | :if ($schedulerFound = 0) do={ | |
| 19 | + | /system scheduler add disabled=no interval=1d name=UpdateGeoIPSchedule on-event="/system script run UpdateGeoIP_IL;" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=\ | |
| 20 | + | 1970-01-01 start-time=01:00:00 | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | } on-error={ | |
| 24 | + | :log warning "Error while installing UpdateGeoIP_IL scripts" | |
| 25 | + | } | |
Plus récent
Plus ancien