luci-base: sys.uc: increase init script START/STOP search space

Some init scripts, such as the sysfsutils one, declare their START or
STOP variables very late in the file. Duplicate the search buffer to
2048 byte in order to catch these cases.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2022-09-26 10:50:40 +02:00
parent 7e30a5e11e
commit 60a9f01978

View file

@ -121,7 +121,7 @@ export function init_list() {
};
export function init_index(name) {
const src = readfile(`/etc/init.d/${basename(name)}`, 1024);
const src = readfile(`/etc/init.d/${basename(name)}`, 2048);
const idx = [];
for (let m in match(src, /^[[:space:]]*(START|STOP)=('[0-9][0-9]'|"[0-9][0-9]"|[0-9][0-9])[[:space:]]*$/gs)) {