diff --git a/cmd/yggdrasilctl/main.go b/cmd/yggdrasilctl/main.go index bbe3cd2e..52800620 100644 --- a/cmd/yggdrasilctl/main.go +++ b/cmd/yggdrasilctl/main.go @@ -388,14 +388,18 @@ func main() { } } case "getroutes": - if _, ok := res["routes"]; !ok { - fmt.Println("No routes found") - } else if res["routes"] == nil { + if routes, ok := res["routes"].(map[string]interface{}); !ok { fmt.Println("No routes found") } else { - fmt.Println("Routes:") - for _, v := range res["routes"].([]interface{}) { - fmt.Println("-", v) + if res["routes"] == nil || len(routes) == 0 { + fmt.Println("No routes found") + } else { + fmt.Println("Routes:") + for k, v := range routes { + if pv, ok := v.(string); ok { + fmt.Println("-", k, " via ", pv) + } + } } } default: