Skip to content

Run console commands via a temp script (fixes scripts not executing) - #5

Merged
Belfagor2005 merged 1 commit into
OwnerPlugins:mainfrom
pQu4k3r:develop
Aug 11, 2026
Merged

Run console commands via a temp script (fixes scripts not executing)#5
Belfagor2005 merged 1 commit into
OwnerPlugins:mainfrom
pQu4k3r:develop

Conversation

@pQu4k3r

@pQu4k3r pQu4k3r commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

eConsoleAppContainer.execute() is not consistent across images: some run the given string through a shell, some split it on whitespace. The previous approach wrapped remote commands in /bin/sh -c "..." but exempted anything starting with "sh " - so local sh/ scripts reached execute() as 'sh "..." > log 2>&1' with the redirect intact, and on a word-splitting image the redirect tokens became literal arguments and the script silently failed. Remote pipelines were similarly fragile.

Instead of guessing how execute() parses the string, write the whole command to a real temp script (/tmp/.lsconsole_.sh) and run '/bin/sh <script>'. A script file is always interpreted by /bin/sh exactly as written, so pipes, redirects, && chains and embedded quotes (the ?inline=false URLs) all work identically on every image. The multi-command path in runFinished now goes through the same helper (it previously executed raw, bypassing any wrapping).

Verified by executing all four command shapes (piped remote, embedded quotes, opkg && chain, local sh script with redirect) through the real shell.

eConsoleAppContainer.execute() is not consistent across images: some
run the given string through a shell, some split it on whitespace. The
previous approach wrapped remote commands in /bin/sh -c "..." but
exempted anything starting with "sh " - so local sh/ scripts reached
execute() as 'sh "..." > log 2>&1' with the redirect intact, and on a
word-splitting image the redirect tokens became literal arguments and
the script silently failed. Remote pipelines were similarly fragile.

Instead of guessing how execute() parses the string, write the whole
command to a real temp script (/tmp/.lsconsole_<run>.sh) and run
'/bin/sh <script>'. A script file is always interpreted by /bin/sh
exactly as written, so pipes, redirects, && chains and embedded quotes
(the ?inline=false URLs) all work identically on every image. The
multi-command path in runFinished now goes through the same helper
(it previously executed raw, bypassing any wrapping).

Verified by executing all four command shapes (piped remote, embedded
quotes, opkg && chain, local sh script with redirect) through the real
shell.
@pQu4k3r
pQu4k3r requested a review from Belfagor2005 August 11, 2026 14:36
@pQu4k3r pQu4k3r self-assigned this Aug 11, 2026
@Belfagor2005
Belfagor2005 merged commit 34d39ee into OwnerPlugins:main Aug 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants