modified config file

This commit is contained in:
2021-07-22 13:04:25 +04:00
parent c3647c2fe7
commit 4e0fd09d73
10 changed files with 99 additions and 23 deletions

View File

@@ -23,13 +23,24 @@ var CliAction = func(ctx *cli.Context) error {
if err != nil {
fmt.Print(err)
}
p2p.PrintIpTable()
// Reads from ip table and passes it
// on to struct print function
Servers, err := p2p.ReadIpTable()
if err != nil {
return err
}
client.PrettyPrint(Servers)
}
// Displays the IP table
if ServerList {
p2p.PrintIpTable()
// Reads from ip table and passes it
// on to struct print function
Servers, err := p2p.ReadIpTable()
if err != nil {
return err
}
client.PrettyPrint(Servers)
}
// Add provided IP to the IP table
@@ -51,6 +62,13 @@ var CliAction = func(ctx *cli.Context) error {
} else {
IpAddr.Ipv4 = AddServer
}
// If a server port is provided then set it
if Ports != "" {
IpAddr.ServerPort = Ports
} else {
IpAddr.ServerPort = "8088"
}
// Append IP address to variable result which
// is a list
res.IpAddress = append(res.IpAddress, IpAddr)