From 12cc7fc639cae30b52c7826b2603044cb69fbf1f Mon Sep 17 00:00:00 2001 From: Arceliar Date: Thu, 22 Nov 2018 21:37:57 -0600 Subject: [PATCH] add yggdrasilctl support for getSourceSubnets and getRoutes --- yggdrasilctl.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/yggdrasilctl.go b/yggdrasilctl.go index 6cc43e86..a3e24096 100644 --- a/yggdrasilctl.go +++ b/yggdrasilctl.go @@ -274,6 +274,28 @@ func main() { fmt.Println("-", v) } } + case "getsourcesubnets": + if _, ok := res["source_subnets"]; !ok { + fmt.Println("No source subnets found") + } else if res["source_subnets"] == nil { + fmt.Println("No source subnets found") + } else { + fmt.Println("Source subnets:") + for _, v := range res["source_subnets"].([]interface{}) { + fmt.Println("-", v) + } + } + case "getroutes": + if _, ok := res["routes"]; !ok { + fmt.Println("No routes found") + } else if res["routes"] == nil { + fmt.Println("No routes found") + } else { + fmt.Println("Routes:") + for _, v := range res["routes"].([]interface{}) { + fmt.Println("-", v) + } + } default: if json, err := json.MarshalIndent(recv["response"], "", " "); err == nil { fmt.Println(string(json))