script-updates: check and warn about policies

This commit is contained in:
Christian Hesse 2018-09-13 13:16:14 +02:00
parent dcf795464b
commit 374c9c09ba

View file

@ -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; }