mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-26 19:54:15 +00:00
Fix getSelf in yggdrasilctl
This commit is contained in:
@@ -181,6 +181,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
case "getself":
|
case "getself":
|
||||||
for k, v := range res["self"].(map[string]interface{}) {
|
for k, v := range res["self"].(map[string]interface{}) {
|
||||||
|
if friendlyname, ok := v.(map[string]interface{})["friendly_name"].(string); ok {
|
||||||
|
if friendlyname == "" {
|
||||||
|
fmt.Println("Friendly name: (none)")
|
||||||
|
} else {
|
||||||
|
fmt.Println("Friendly name:", friendlyname)
|
||||||
|
}
|
||||||
|
}
|
||||||
fmt.Println("IPv6 address:", k)
|
fmt.Println("IPv6 address:", k)
|
||||||
if subnet, ok := v.(map[string]interface{})["subnet"].(string); ok {
|
if subnet, ok := v.(map[string]interface{})["subnet"].(string); ok {
|
||||||
fmt.Println("IPv6 subnet:", subnet)
|
fmt.Println("IPv6 subnet:", subnet)
|
||||||
|
Reference in New Issue
Block a user