aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-02-16 16:13:41 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-02-16 16:45:13 +0100
commitefca1ec049822e56a63fb6c772863694c3267756 (patch)
tree3d3763cf6424c53bcd82a566893da1cdca1259f5
parent28db4732998da95a33a6f7698038b20a0be13473 (diff)
global-functions: drop $MailServerIsUp
Now that we have an e-mail queue we do not care if the server is up or not.
-rw-r--r--global-functions47
-rw-r--r--log-forward5
-rw-r--r--sms-forward5
3 files changed, 0 insertions, 57 deletions
diff --git a/global-functions b/global-functions
index 889dcea..8f4795d 100644
--- a/global-functions
+++ b/global-functions
@@ -32,7 +32,6 @@
:global IfThenElse;
:global IPCalc;
:global LogPrintExit;
-:global MailServerIsUp;
:global MkDir;
:global ParseKeyValueStore;
:global RandomDelay;
@@ -486,52 +485,6 @@
}
}
-# check if mail server is up
-:set MailServerIsUp do={
- :local MailServer [ / tool e-mail get address ];
-
- :global EmailGeneralTo;
-
- :global LogPrintExit;
-
- :if ([ :len $EmailGeneralTo ] = 0) do={
- :return true;
- } else={
- :if ($MailServer = "0.0.0.0") do={
- $LogPrintExit info ("No mail server is configured! Returning gracefully...") false;
- :return true;
- }
- }
-
- :if ([ :len [ / tool netwatch find where comment=$MailServer ] ] = 0) do={
- $LogPrintExit info ("Adding netwatch entry for mail server.") false;
- :local MailHost $MailServer;
- :if ([ :typeof [ :toip $MailHost ] ] != "ip" ) do={
- :do {
- :set MailHost [ :resolve $MailServer ];
- } on-error={
- $LogPrintExit warning ("Resolving mail server failed.") false;
- :return false;
- }
- }
- / tool netwatch add comment=$MailServer host=$MailHost;
- }
-
- :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;
- }
-
- :return false;
-}
-
# create directory
:set MkDir do={
:local Dir [ :tostr $1 ];
diff --git a/log-forward b/log-forward
index feebedd..ae9a352 100644
--- a/log-forward
+++ b/log-forward
@@ -14,7 +14,6 @@
:global IfThenElse;
:global LogPrintExit;
-:global MailServerIsUp;
:global ScriptLock;
:global SendNotification;
:global SymbolForNotification;
@@ -33,10 +32,6 @@ $ScriptLock "log-forward";
$WaitFullyConnected;
-:if ([ $MailServerIsUp ] = false) do={
- $LogPrintExit warning ("Mail server is not up.") true;
-}
-
:local Count 0;
:local Messages "";
:local MessageVal;
diff --git a/sms-forward b/sms-forward
index 96a001d..3cfb3f0 100644
--- a/sms-forward
+++ b/sms-forward
@@ -10,7 +10,6 @@
:global IfThenElse;
:global LogPrintExit;
-:global MailServerIsUp;
:global ScriptLock;
:global SendNotification;
:global SymbolForNotification;
@@ -24,10 +23,6 @@ $ScriptLock "sms-forward";
$WaitFullyConnected;
-:if ([ $MailServerIsUp ] = false) do={
- $LogPrintExit warning "Mail server is not up." true;
-}
-
:local Settings [ / tool sms get ];
# forward SMS in a loop