This commit is contained in:
2025-08-28 16:02:28 +02:00
parent d52aa5dbd4
commit fb87adf87d
44 changed files with 480 additions and 507 deletions

View File

@@ -54,13 +54,13 @@ pub fn (mut executor ExecutorSSH) exec(args_ ExecArgs) !string {
port = '-p ${executor.ipaddr.port}'
}
if args.cmd.contains("\n"){
//need to upload the file first
if args.cmd.contains('\n') {
// need to upload the file first
args.cmd = texttools.dedent(args.cmd)
executor.file_write('/tmp/toexec.sh', args.cmd)!
args.cmd = "bash /tmp/toexec.sh"
args.cmd = 'bash /tmp/toexec.sh'
}
args.cmd = 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${executor.user}@${executor.ipaddr.addr} ${port} "${args.cmd}"'
res := osal.exec(cmd: args.cmd, stdout: args.stdout, debug: executor.debug)!
@@ -74,11 +74,11 @@ pub fn (mut executor ExecutorSSH) exec_interactive(args_ ExecArgs) ! {
port = '-p ${executor.ipaddr.port}'
}
if args.cmd.contains("\n"){
if args.cmd.contains('\n') {
args.cmd = texttools.dedent(args.cmd)
//need to upload the file first
// need to upload the file first
executor.file_write('/tmp/toexec.sh', args.cmd)!
args.cmd = "bash /tmp/toexec.sh"
args.cmd = 'bash /tmp/toexec.sh'
}
args.cmd = 'ssh -tt -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${executor.user}@${executor.ipaddr.addr} ${port} "${args.cmd}"'