Add option to get info for a single script in list method.
To get info of a particular script pass the name arg to the list method.
If the script doesn't exist an empty table is returned.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Running check may be slow and increase result time in the other of 70ms
for the list method.
Add an option to skip running check by passing the skip_running_check as
true in the list method args to speedup execution if the running info is
not needed.
With the option set to true the execution time lower to just 5ms.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Running check is supported only in procd scripts. This cause prolonged
execution time since the function needs to timeout.
To fix this check if the script USE_PROCD and run running check only if
supported.
Also provide running info only if the running check is supported.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Currently we stop searching at the first occurence of START or STOP
entry. This is wrong since we totally miss the other data (START or
STOP) in the occurence of the other.
Fix and improve script scanning by:
- Increase the line max length to 255 char to read it in one go.
- Scan only the first 10 lines.
- Don't stop at the first occurence and try to search also for the other
data.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>