aboutsummaryrefslogtreecommitdiffstats
path: root/c_parse.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-18 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-18 20:20:20 +0100
commitff46232876da57297d6f8b46e311fcd0f659b5cf (patch)
tree300b49d4c3ba84d1a7ac8e0a06ba68563c03395d /c_parse.go
parentadded LICENSE (diff)
downloadhardflip-ff46232876da57297d6f8b46e311fcd0f659b5cf.tar.gz
hardflip-ff46232876da57297d6f8b46e311fcd0f659b5cf.tar.bz2
hardflip-ff46232876da57297d6f8b46e311fcd0f659b5cf.tar.xz
hardflip-ff46232876da57297d6f8b46e311fcd0f659b5cf.tar.zst
hardflip-ff46232876da57297d6f8b46e311fcd0f659b5cf.zip
up
Diffstat (limited to '')
-rw-r--r--c_parse.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/c_parse.go b/c_parse.go
index 358b2d3..43a270c 100644
--- a/c_parse.go
+++ b/c_parse.go
@@ -68,5 +68,19 @@ func c_read_yaml_file(file string) *HostNode {
if len(host.Host) == 0 {
return nil
}
+ if host.Type == 0 {
+ if host.Port == 0 {
+ host.Port = 22
+ }
+ if len(host.User) == 0 {
+ host.User = "root"
+ }
+ } else if host.Type == 1 {
+ if host.Port == 0 {
+ host.Port = 3389
+ }
+ } else if host.Type > 1 {
+ host_type = "Unknown"
+ }
return &host
}