diff options
Diffstat (limited to 'tools/numap/numap.go')
-rw-r--r-- | tools/numap/numap.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/numap/numap.go b/tools/numap/numap.go new file mode 100644 index 0000000..c65f1f0 --- /dev/null +++ b/tools/numap/numap.go @@ -0,0 +1,31 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + + "golang.fcuny.net/numap/internal/hwids" +) + +func main() { + hwdb, err := hwids.Load() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + nodes, err := findNodes(hwdb) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + out, err := json.Marshal(nodes) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + fmt.Println(string(out)) +} |