...
This commit is contained in:
@@ -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}"'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user