From 49c424ef213589d63215f10dc1958b2e93fb1e6c Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 4 Nov 2023 18:42:51 +0000 Subject: [PATCH] Add `-publickey` command line switch (#1096) Co-authored-by: Neil Alexander --- cmd/yggdrasil/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go index 975e494..a225755 100644 --- a/cmd/yggdrasil/main.go +++ b/cmd/yggdrasil/main.go @@ -48,8 +48,9 @@ func main() { autoconf := flag.Bool("autoconf", false, "automatic mode (dynamic IP, peer with IPv6 neighbors)") ver := flag.Bool("version", false, "prints the version of this build") logto := flag.String("logto", "stdout", "file path to log to, \"syslog\" or \"stdout\"") - getaddr := flag.Bool("address", false, "returns the IPv6 address as derived from the supplied configuration") - getsnet := flag.Bool("subnet", false, "returns the IPv6 subnet as derived from the supplied configuration") + getaddr := flag.Bool("address", false, "use in combination with either -useconf or -useconffile, outputs your IPv6 address") + getsnet := flag.Bool("subnet", false, "use in combination with either -useconf or -useconffile, outputs your IPv6 subnet") + getpkey := flag.Bool("publickey", false, "use in combination with either -useconf or -useconffile, outputs your public key") loglevel := flag.String("loglevel", "info", "loglevel to enable") flag.Parse() @@ -155,6 +156,10 @@ func main() { fmt.Println(ipnet.String()) return + case *getpkey: + fmt.Println(hex.EncodeToString(publicKey)) + return + case *normaliseconf: cfg.AdminListen = "" var bs []byte