From c4ff95b3aeed3abb588ee94bc02d4c50310f3857 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 14 Jul 2020 10:59:08 +0200 Subject: global-functions: $MailServerIsUp: do immediate check --- global-functions | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/global-functions b/global-functions index 687fb6c..15a5186 100644 --- a/global-functions +++ b/global-functions @@ -400,7 +400,15 @@ / tool netwatch add comment=$MailServer host=$MailHost; } - :if ([ / tool netwatch get [ find where comment=$MailServer ] status ] = "up") do={ + :local NetWatch [ / tool netwatch find where comment=$MailServer ]; + :local NetWatchVal [ / tool netwatch get $NetWatch ]; + :if ($NetWatchVal->"status" = "up") do={ + :return true; + } + + / tool netwatch set interval=($NetWatchVal->"interval") $NetWatch; + :delay ($NetWatchVal->"timeout"); + :if ([ / tool netwatch get $NetWatch status ] = "up") do={ :return true; } -- cgit v1.2.3-54-g00ecf