diff options
author | Joe <rbo@gmx.us> | 2023-12-19 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-19 20:20:20 +0100 |
commit | b9a79ec3d1c2dc1b90924477501a4470e57f9c01 (patch) | |
tree | 7d49f94f957beecbccc9b97cd91d8a36b647d914 /c_parse.go | |
parent | up (diff) | |
download | hardflip-b9a79ec3d1c2dc1b90924477501a4470e57f9c01.tar.gz hardflip-b9a79ec3d1c2dc1b90924477501a4470e57f9c01.tar.bz2 hardflip-b9a79ec3d1c2dc1b90924477501a4470e57f9c01.tar.xz hardflip-b9a79ec3d1c2dc1b90924477501a4470e57f9c01.tar.zst hardflip-b9a79ec3d1c2dc1b90924477501a4470e57f9c01.zip |
go
Diffstat (limited to 'c_parse.go')
-rw-r--r-- | c_parse.go | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -48,13 +48,13 @@ package main import ( - "io/ioutil" + "os" "gopkg.in/yaml.v3" ) func c_read_yaml_file(file string) *HostNode { var host HostNode - yaml_file, err := ioutil.ReadFile(file) + yaml_file, err := os.ReadFile(file) if err != nil { c_die("error reading file " + file, err) @@ -75,12 +75,20 @@ func c_read_yaml_file(file string) *HostNode { if len(host.User) == 0 { host.User = "root" } + if len(host.Jump) > 0 { + if host.JumpPort == 0 { + host.JumpPort = 22 + } + if len(host.JumpUser) == 0 { + host.JumpUser = "root" + } + } } else if host.Type == 1 { if host.Port == 0 { host.Port = 3389 } } else if host.Type > 1 { - host_type = "Unknown" + return nil } return &host } |