aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-15 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-15 20:20:20 +0100
commita5c130f8f7e675b3c8531485e43baf214379080c (patch)
treedfcfd40a642f2b8c9f300b544871e2645b2c4e05
parentgood shit (diff)
downloadhardflip-a5c130f8f7e675b3c8531485e43baf214379080c.tar.gz
hardflip-a5c130f8f7e675b3c8531485e43baf214379080c.tar.bz2
hardflip-a5c130f8f7e675b3c8531485e43baf214379080c.tar.xz
hardflip-a5c130f8f7e675b3c8531485e43baf214379080c.tar.zst
hardflip-a5c130f8f7e675b3c8531485e43baf214379080c.zip
gogo
Diffstat (limited to '')
-rw-r--r--c_init.go5
-rw-r--r--c_lhosts.go4
2 files changed, 7 insertions, 2 deletions
diff --git a/c_init.go b/c_init.go
index 7a1293a..53b060b 100644
--- a/c_init.go
+++ b/c_init.go
@@ -94,7 +94,10 @@ func c_recurse_data_dir(dir string, root string, lhost *HostList) {
c_recurse_data_dir(dir + file.Name() + "/", root, lhost)
} else if filepath.Ext(file.Name()) == ".yml" {
host := c_read_yaml_file(root + dir + file.Name())
- host.Path = dir + file.Name()[0:len(file.Name()) - 4]
+ if len(host.Name) == 0 {
+ return
+ }
+ host.Path = dir + file.Name()
lhost.add_back(host)
}
}
diff --git a/c_lhosts.go b/c_lhosts.go
index 67bb5a2..67a2944 100644
--- a/c_lhosts.go
+++ b/c_lhosts.go
@@ -52,12 +52,14 @@ package main
type HostNode struct {
ID uint64
Type int8 `yaml:"type"`
+ Name string `yaml:"name"`
Host string `yaml:"host"`
Port uint16 `yaml:"port"`
User string `yaml:"user"`
Pass string `yaml:"pass"`
Jump string `yaml:"jump"`
Priv string `yaml:"priv"`
+ Note string `yaml:"note"`
Path string
next *HostNode
}
@@ -83,7 +85,7 @@ func (lhost *HostList) add_back(node *HostNode) {
}
// removes a host node from the list
-func (lhost *HostList) remove(id uint64) {
+func (lhost *HostList) del(id uint64) {
if lhost.head == nil {
return
}