aboutsummaryrefslogtreecommitdiffstats
path: root/lease-script
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-01-20 08:58:46 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-01-20 11:26:53 +0100
commit9887ab084996cd8babd60c534edd5f7ff87e49f3 (patch)
tree1f61889f8de729e9989921117e2c04bd8c6eb038 /lease-script
parentb834517baac25495a9376b255cedb670545c74ad (diff)
lease-script: use $Grep
Diffstat (limited to 'lease-script')
-rw-r--r--lease-script11
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={