From 9887ab084996cd8babd60c534edd5f7ff87e49f3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 20 Jan 2023 08:58:46 +0100 Subject: lease-script: use $Grep --- lease-script | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lease-script') 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={ -- cgit v1.2.3-70-g09d2