global: give script or function name in log messages

This commit is contained in:
Christian Hesse 2021-02-22 15:14:10 +01:00
parent b0e52aa2d1
commit f46db91845
46 changed files with 262 additions and 212 deletions

View file

@ -6,17 +6,18 @@
# run action on received SMS
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-action.md
:local 0 "sms-action";
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global SmsAction;
:global LogPrintExit;
:global LogPrintExit2;
:local Action $action;
:if ([ :typeof $Action ] = "nothing") do={
$LogPrintExit error "This script is supposed to run from SMS hook with action=..." true;
$LogPrintExit2 error $0 ("This script is supposed to run from SMS hook with action=...") true;
}
:local Code ($SmsAction->$Action);