aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c_exec.go6
-rw-r--r--src/c_lhosts.go1
-rw-r--r--src/c_parse.go7
-rw-r--r--src/i_info.go12
4 files changed, 23 insertions, 3 deletions
diff --git a/src/c_exec.go b/src/c_exec.go
index ba93ec0..722df37 100644
--- a/src/c_exec.go
+++ b/src/c_exec.go
@@ -120,16 +120,20 @@ func c_format_ssh(host *HostNode, pass string) ([]string, []string) {
func c_format_rdp(host *HostNode, pass string) ([]string, []string) {
cmd_fmt := []string{"xfreerdp"}
+ if len(host.RDPFile) > 0 {
+ cmd_fmt = append(cmd_fmt, host.RDPFile)
+ } else {
cmd_fmt = append(cmd_fmt,
"/v:" + host.Host,
"/u:" + host.User)
+ }
if len(host.Domain) > 0 {
cmd_fmt = append(cmd_fmt, "/d:" + host.Domain)
}
if len(pass) > 0 {
cmd_fmt = append(cmd_fmt, "/p:" + pass)
}
- if host.Port != 0 {
+ if host.Port != 0 && len(host.RDPFile) == 0 {
cmd_fmt = append(cmd_fmt, "/port:" + strconv.Itoa(int(host.Port)))
}
if host.Dynamic == true {
diff --git a/src/c_lhosts.go b/src/c_lhosts.go
index 869b0f9..4548d4e 100644
--- a/src/c_lhosts.go
+++ b/src/c_lhosts.go
@@ -84,6 +84,7 @@ type HostNode struct {
User string `yaml:"user"`
Pass string `yaml:"pass"`
Priv string `yaml:"priv"`
+ RDPFile string `yaml:"rdp_file"`
Jump JumpSettings `yaml:"jump"`
Quality uint8 `yaml:"quality"`
Domain string `yaml:"domain"`
diff --git a/src/c_parse.go b/src/c_parse.go
index 11d1677..5375874 100644
--- a/src/c_parse.go
+++ b/src/c_parse.go
@@ -85,7 +85,12 @@ func c_read_yaml_file(file string, ui *HardUI) (*HostNode, error) {
return nil, nil
}
if len(host.Host) == 0 {
- return nil, nil
+ if len(host.RDPFile) > 0 {
+ host.Host = "rdp_file"
+ host.User = "rdp_file"
+ } else {
+ return nil, nil
+ }
}
if host.Protocol == 0 {
if host.Port == 0 {
diff --git a/src/i_info.go b/src/i_info.go
index 85929b4..14eb9b0 100644
--- a/src/i_info.go
+++ b/src/i_info.go
@@ -224,8 +224,18 @@ func i_info_rdp(ui HardUI, host *HostNode, line int) int {
i_draw_text(ui.s,
(ui.dim[W] / 3) + 11, line, ui.dim[W] - 2, line,
ui.style[STYLE_DEF], host.Domain)
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ }
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ if len(host.RDPFile) > 0 {
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line,
+ ui.style[STYLE_TITLE], "RDP File: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 13, line, ui.dim[W] - 2, line,
+ ui.style[STYLE_DEF], host.RDPFile)
+ if line += 2; line > ui.dim[H] - 3 { return line }
}
- if line += 2; line > ui.dim[H] - 3 { return line }
// user infos
i_draw_text(ui.s,
(ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line,