mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
script-updates: check and warn about policies
This commit is contained in:
parent
dcf795464b
commit
374c9c09ba
1 changed files with 10 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
:foreach script in=[ / system script find ] do={
|
||||
:local ignore 0;
|
||||
:local scriptname [ / system script get $script name ];
|
||||
:local scriptpolicy [ / system script get $script policy ];
|
||||
:local scriptfile [ / file find where name=("script-updates/" . $scriptname) ];
|
||||
:local sourcenew;
|
||||
:if ([ :len $scriptfile ] > 0) do={
|
||||
|
@ -19,6 +20,15 @@
|
|||
/ file remove $scriptfile;
|
||||
}
|
||||
|
||||
:foreach scheduler in=[ / system scheduler find where on-event=$scriptname ] do={
|
||||
:local schedulername [ / system scheduler get $scheduler name ];
|
||||
:local schedulerpolicy [ / system scheduler get $scheduler policy ];
|
||||
:if ($scriptpolicy != schedulerpolicy) do={
|
||||
:log warning ("Policies differ for script " . $scriptname . \
|
||||
" and its scheduler " . $schedulername . "!");
|
||||
}
|
||||
}
|
||||
|
||||
:if ([ :len $sourcenew ] = 0 && $"script-updates-fetch" = true) do={
|
||||
:foreach "ignore-loop" in=$"script-updates-ignore" do={
|
||||
:if ($"ignore-loop" = $scriptname) do={ :set ignore 1; }
|
||||
|
|
Loading…
Reference in a new issue