From 374c9c09ba93e5cefde9cf21799e5ae65720bcd7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 13 Sep 2018 13:16:14 +0200 Subject: script-updates: check and warn about policies --- script-updates | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'script-updates') diff --git a/script-updates b/script-updates index c872cd2..c8efc1f 100644 --- a/script-updates +++ b/script-updates @@ -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; } -- cgit v1.2.3-70-g09d2