mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $ScriptFromTerminal: use $LogPrintExit
This commit is contained in:
parent
9c3ce55ee4
commit
6f354c8bb0
1 changed files with 4 additions and 1 deletions
|
@ -379,16 +379,19 @@
|
|||
:set ScriptFromTerminal do={
|
||||
:local Script [ :tostr $1 ];
|
||||
|
||||
:global LogPrintExit;
|
||||
|
||||
:foreach Job in=[ / system script job find where script=$Script ] do={
|
||||
:set Job [ / system script job get $Job ];
|
||||
:while ([ :typeof ($Job->"parent") ] = "id") do={
|
||||
:set Job [ / system script job get [ find where .id=($Job->"parent") ] ];
|
||||
}
|
||||
:if (($Job->"type") = "login") do={
|
||||
:log debug ("Script " . $Script . " started from terminal.");
|
||||
$LogPrintExit debug ("Script " . $Script . " started from terminal.") false;
|
||||
:return true;
|
||||
}
|
||||
}
|
||||
$LogPrintExit debug ("Script " . $Script . " NOT started from terminal.") false;
|
||||
|
||||
:return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue