From 2053c5ab536455f598bc1a148577c29cff021f3c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 5 May 2025 18:01:28 +0200 Subject: [PATCH] dhcp-lease-comment: fail if global functions do not become ready Co-authored-by: Ilya Kulakov --- dhcp-lease-comment.capsman.rsc | 3 ++- dhcp-lease-comment.local.rsc | 3 ++- dhcp-lease-comment.template.rsc | 3 ++- dhcp-lease-comment.wifi.rsc | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc index 36b31c85..2749c66c 100644 --- a/dhcp-lease-comment.capsman.rsc +++ b/dhcp-lease-comment.capsman.rsc @@ -12,7 +12,8 @@ # !! Do not edit this file, it is generated from template! :global GlobalFunctionsReady; -:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:onerror e { :retry { :if ($GlobalFunctionsReady != true) \ + do={ :error "Global functions not ready."; }; } delay=500ms max=20; } do={ :log error $e; }; :local ExitOK false; :do { diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index 35dc6f68..04c589d2 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -12,7 +12,8 @@ # !! Do not edit this file, it is generated from template! :global GlobalFunctionsReady; -:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:onerror e { :retry { :if ($GlobalFunctionsReady != true) \ + do={ :error "Global functions not ready."; }; } delay=500ms max=20; } do={ :log error $e; }; :local ExitOK false; :do { diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc index 47a85542..1593291c 100644 --- a/dhcp-lease-comment.template.rsc +++ b/dhcp-lease-comment.template.rsc @@ -13,7 +13,8 @@ # !! Pattern '%TEMPL%' is replaced, paths are filtered. :global GlobalFunctionsReady; -:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:onerror e { :retry { :if ($GlobalFunctionsReady != true) \ + do={ :error "Global functions not ready."; }; } delay=500ms max=20; } do={ :log error $e; }; :local ExitOK false; :do { diff --git a/dhcp-lease-comment.wifi.rsc b/dhcp-lease-comment.wifi.rsc index e0f97851..110c5e6d 100644 --- a/dhcp-lease-comment.wifi.rsc +++ b/dhcp-lease-comment.wifi.rsc @@ -12,7 +12,8 @@ # !! Do not edit this file, it is generated from template! :global GlobalFunctionsReady; -:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:onerror e { :retry { :if ($GlobalFunctionsReady != true) \ + do={ :error "Global functions not ready."; }; } delay=500ms max=20; } do={ :log error $e; }; :local ExitOK false; :do {