global-functions: $ScriptFromTerminal: use $LogPrintExit

This commit is contained in:
Christian Hesse 2020-04-03 16:50:21 +02:00
parent 9c3ce55ee4
commit 6f354c8bb0

View file

@ -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;
}