diff options
Diffstat (limited to '')
-rw-r--r-- | c_init.go | 2 | ||||
-rw-r--r-- | c_lhosts.go | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -93,8 +93,8 @@ func c_recurse_data_dir(dir string, root string, lhost *HostList) { if file.IsDir() == true { c_recurse_data_dir(dir + file.Name() + "/", root, lhost) } else if filepath.Ext(file.Name()) == ".yml" { - fmt.Println(dir + file.Name()) host := c_read_yaml_file(root + dir + file.Name()) + host.Path = dir + file.Name()[0:len(file.Name()) - 4] lhost.add_back(host) } } diff --git a/c_lhosts.go b/c_lhosts.go index aa32681..67bb5a2 100644 --- a/c_lhosts.go +++ b/c_lhosts.go @@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * josh: src/c_lhosts.go - * Fri, 15 Dec 2023 11:43:34 +0100 + * Fri, 15 Dec 2023 12:22:05 +0100 * Joe * * the hosts linked list @@ -58,6 +58,7 @@ type HostNode struct { Pass string `yaml:"pass"` Jump string `yaml:"jump"` Priv string `yaml:"priv"` + Path string next *HostNode } @@ -77,6 +78,7 @@ func (lhost *HostList) add_back(node *HostNode) { for curr.next != nil { curr = curr.next } + new_node.ID = curr.ID + 1 curr.next = new_node } |