From fde32d4a1a3d036ec720e4c9986afe7fece3de61 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 1 Feb 2024 20:20:20 +0100 Subject: better jump --- src/c_exec.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/c_exec.go') diff --git a/src/c_exec.go b/src/c_exec.go index 7bfcbc9..46b9939 100644 --- a/src/c_exec.go +++ b/src/c_exec.go @@ -71,18 +71,18 @@ func c_exec_cmd(cmd_fmt []string) { func c_format_ssh_jump(host *HostNode) string { jump_fmt := "-oProxyCommand=ssh" - if len(host.JumpPriv) > 0 { - jump_fmt += " -i " + host.JumpPriv + if len(host.Jump.Priv) > 0 { + jump_fmt += " -i " + host.Jump.Priv } - if host.JumpPort != 0 { - jump_fmt += " -p " + strconv.Itoa(int(host.JumpPort)) + if host.Jump.Port != 0 { + jump_fmt += " -p " + strconv.Itoa(int(host.Jump.Port)) } - if len(host.JumpUser) == 0 { + if len(host.Jump.User) == 0 { jump_fmt += " root" } else { - jump_fmt += " " + host.JumpUser + jump_fmt += " " + host.Jump.User } - jump_fmt += "@" + host.Jump + " -W %h:%p" + jump_fmt += "@" + host.Jump.Host + " -W %h:%p" return jump_fmt } @@ -96,7 +96,7 @@ func c_format_ssh(host *HostNode, pass string) []string { if len(host.Priv) > 0 { cmd_fmt = append(cmd_fmt, "-i", host.Priv) } - if len(host.Jump) > 0 { + if len(host.Jump.Host) > 0 { cmd_fmt = append(cmd_fmt, c_format_ssh_jump(host)) } if host.Port != 0 { -- cgit v1.2.3