diff options
-rw-r--r-- | lease-script | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lease-script b/lease-script index 2ad8e66..346d52b 100644 --- a/lease-script +++ b/lease-script @@ -10,6 +10,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:global Grep; :global IfThenElse; :global LogPrintExit2; :global ParseKeyValueStore; @@ -34,14 +35,10 @@ $ScriptLock $0 false 10; :local RunOrder ({}); :foreach Script in=[ /system/script/find where source~("\n# provides: lease-script, ") ] do={ - :local Name [ /system/script/get $Script name ]; - :local Store [ /system/script/get $Script source ]; + :local ScriptVal [ /system/script/get $Script ]; + :local Store [ $ParseKeyValueStore [ $Grep ($ScriptVal->"source") "# provides: lease-script, " ] ]; - :set Store [ :pick $Store ([ :find $Store "\n# provides: lease-script, " ] + 27) [ :len $Store ] ]; - :set Store [ :pick $Store 0 [ :find $Store "\n" ] ]; - :set Store [ $ParseKeyValueStore $Store ]; - - :set ($RunOrder->($Store->"order")) $Name; + :set ($RunOrder->($Store->"order")) ($ScriptVal->"name"); } :foreach Order,Script in=$RunOrder do={ |