aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-19 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-19 20:20:20 +0100
commit6d39f339ea7b3d88e613cbf65cf71bc9f79033a8 (patch)
tree03f560490a590b1d6d2326185ba330bebd3d0f67
parentfire (diff)
downloadhardflip-6d39f339ea7b3d88e613cbf65cf71bc9f79033a8.tar.gz
hardflip-6d39f339ea7b3d88e613cbf65cf71bc9f79033a8.tar.bz2
hardflip-6d39f339ea7b3d88e613cbf65cf71bc9f79033a8.tar.xz
hardflip-6d39f339ea7b3d88e613cbf65cf71bc9f79033a8.tar.zst
hardflip-6d39f339ea7b3d88e613cbf65cf71bc9f79033a8.zip
rdp support
-rw-r--r--c_exec.go22
-rw-r--r--c_parse.go7
2 files changed, 21 insertions, 8 deletions
diff --git a/c_exec.go b/c_exec.go
index 8193068..05bdf3b 100644
--- a/c_exec.go
+++ b/c_exec.go
@@ -83,7 +83,6 @@ func c_format_ssh_jump(host *HostNode) string {
func c_format_ssh(host *HostNode) []string {
cmd_fmt := []string{"ssh"}
- user := host.User
if len(host.Priv) > 0 {
cmd_fmt = append(cmd_fmt, "-i", host.Priv)
@@ -94,15 +93,26 @@ func c_format_ssh(host *HostNode) []string {
if host.Port != 0 {
cmd_fmt = append(cmd_fmt, "-p", strconv.Itoa(int(host.Port)))
}
- if len(host.User) == 0 {
- user = "root"
- }
- cmd_fmt = append(cmd_fmt, user + "@" + host.Host)
+ cmd_fmt = append(cmd_fmt, host.User + "@" + host.Host)
return cmd_fmt
}
func c_format_rdp(host *HostNode) []string {
- return []string{""}
+ cmd_fmt := []string{"xfreerdp"}
+
+ 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(host.Pass) > 0 {
+ cmd_fmt = append(cmd_fmt, "/p:" + host.Pass)
+ }
+ cmd_fmt = append(cmd_fmt,
+ "/size:" + strconv.Itoa(int(host.Width)) +
+ "x" + strconv.Itoa(int(host.Height)))
+ return cmd_fmt
}
func c_format_cmd(id uint64, lhost *HostList) {
diff --git a/c_parse.go b/c_parse.go
index 83e10d4..d2f1580 100644
--- a/c_parse.go
+++ b/c_parse.go
@@ -84,14 +84,17 @@ func c_read_yaml_file(file string) *HostNode {
}
}
} else if host.Type == 1 {
+ if len(host.User) == 0 {
+ host.User = "Administrator"
+ }
if host.Port == 0 {
host.Port = 3389
}
if host.Width == 0 {
- host.Width = 800
+ host.Width = 1600
}
if host.Height == 0 {
- host.Height = 600
+ host.Height = 1200
}
} else if host.Type > 1 {
return nil