mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-29 04:50:07 +02:00
Initial Commit. First Release
This commit is contained in:
parent
69ab2f58ca
commit
a9d2fcc235
4 changed files with 91 additions and 2 deletions
|
@ -1,2 +1,28 @@
|
|||
:global n [file get value-name=name number=2]
|
||||
:if ($n ~ ".txt") do={/file remove $n} else={:put "No"}
|
||||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Removes files by specific name or file extansion
|
||||
|
||||
:global FileScreening do={
|
||||
|
||||
:local systemName [/system identity get name];
|
||||
:local filesNumber [/file print count-only];
|
||||
|
||||
:local fileName;
|
||||
|
||||
:for i from=0 to=$filesNumber step=1 do= \
|
||||
{
|
||||
|
||||
:set fileName [/file get value-name=name number=$i];
|
||||
|
||||
:if ($fileName ~ $keyWord) do={
|
||||
|
||||
/file remove $fileName;
|
||||
|
||||
:log warning ("...:::".$fileName." removed. Matched ".$keyWord.":::...");
|
||||
:set fileName;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$FileScreening keyWord=".txt";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue