Fix SSH command quoting — pass cmd directly, drop sh -c wrapper
This commit is contained in:
parent
603a41f04a
commit
801b1e6bd8
1 changed files with 2 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ async function sshExec(host, command) {
|
||||||
'-o', 'UserKnownHostsFile=/dev/null',
|
'-o', 'UserKnownHostsFile=/dev/null',
|
||||||
'-o', 'ConnectTimeout=5',
|
'-o', 'ConnectTimeout=5',
|
||||||
`root@${host}`,
|
`root@${host}`,
|
||||||
'sh', '-c', command,
|
command,
|
||||||
], { shell: false })
|
], { shell: false })
|
||||||
let stdout = '', stderr = ''
|
let stdout = '', stderr = ''
|
||||||
child.stdout?.on('data', d => { stdout += d })
|
child.stdout?.on('data', d => { stdout += d })
|
||||||
|
|
@ -208,7 +208,7 @@ async function runRemote(target, repoName, cmd, label) {
|
||||||
'-o', 'StrictHostKeyChecking=no',
|
'-o', 'StrictHostKeyChecking=no',
|
||||||
'-o', 'UserKnownHostsFile=/dev/null',
|
'-o', 'UserKnownHostsFile=/dev/null',
|
||||||
`root@${target.host}`,
|
`root@${target.host}`,
|
||||||
'sh', '-c', cmd,
|
cmd,
|
||||||
], { timeout: 300_000 })
|
], { timeout: 300_000 })
|
||||||
entry.status = 'success'
|
entry.status = 'success'
|
||||||
entry.output = stdout.slice(-500)
|
entry.output = stdout.slice(-500)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue