Skip to content

Commit

Permalink
Updates for Yggdrasil 0.4.5+: the yggdrasilctl cli output has changed…
Browse files Browse the repository at this point in the history
… a bit.
  • Loading branch information
cure committed Feb 12, 2023
1 parent 08ae5c5 commit 990d598
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ func executeYggdrasilCtl(cmd ...string) (out []byte, err error) {
}

func getSelfAddress() (address string, err error) {
out, err := executeYggdrasilCtl("-v", "getSelf")
out, err := executeYggdrasilCtl("getSelf")
if err != nil {
err = fmt.Errorf("Unable to run yggdrasilctl -v getSelf: %s", err.Error())
err = fmt.Errorf("Unable to run yggdrasilctl getSelf: %s", err.Error())
return
}

re := regexp.MustCompile(`(?m)^IPv6 address: (.*?)$`)
re := regexp.MustCompile(`(?m)^IPv6 address:[ \t]*(.*?)[ \t]*$`)
match := re.FindStringSubmatch(string(out))

if len(match) < 2 {
Expand All @@ -461,12 +461,12 @@ func getSelfAddress() (address string, err error) {
}

func getSelfPublicKey() (publicKey string, err error) {
out, err := executeYggdrasilCtl("-v", "getSelf")
out, err := executeYggdrasilCtl("getSelf")
if err != nil {
return
}

re := regexp.MustCompile(`(?m)^Public key: (.*?)$`)
re := regexp.MustCompile(`(?m)^Public key:[ \t]*(.*?)[ \t]*$`)
match := re.FindStringSubmatch(string(out))

if len(match) < 2 {
Expand All @@ -480,12 +480,12 @@ func getSelfPublicKey() (publicKey string, err error) {
}

func getSelfVersion() (version string, err error) {
out, err := executeYggdrasilCtl("-v", "getSelf")
out, err := executeYggdrasilCtl("getSelf")
if err != nil {
return
}

re := regexp.MustCompile(`(?m)^Build version: (.*?)$`)
re := regexp.MustCompile(`(?m)^Build version:[ \t]*(.*?)[ \t]*$`)
match := re.FindStringSubmatch(string(out))

if len(match) < 2 {
Expand Down

0 comments on commit 990d598

Please sign in to comment.