diff --git a/client/cmd/up.go b/client/cmd/up.go index b93d5cbe3..2973b7709 100644 --- a/client/cmd/up.go +++ b/client/cmd/up.go @@ -17,7 +17,6 @@ import ( "google.golang.org/grpc/status" "net/url" "os" - "strings" ) var ( @@ -230,17 +229,16 @@ func loginPeer(serverPublicKey wgtypes.Key, client *mgm.Client) (*mgmProto.Login // promptPeerSetupKey prompts user to input a Setup Key func promptPeerSetupKey() (*string, error) { fmt.Print("Enter setup key: ") - reader := bufio.NewReader(os.Stdin) - input, err := reader.ReadString('\n') - if err != nil { - return nil, err - } - input = strings.TrimSuffix(input, "\n") - if input == "" { - fmt.Print("Specified key is empty, try again.") - return promptPeerSetupKey() + s := bufio.NewScanner(os.Stdin) + for s.Scan() { + input := s.Text() + if input != "" { + return &input, nil + } + fmt.Println("Specified key is empty, try again:") + } - return &input, err + return nil, s.Err() } diff --git a/resources.rc b/client/resources.rc similarity index 100% rename from resources.rc rename to client/resources.rc diff --git a/resources_windows_amd64.syso b/client/resources_windows_amd64.syso similarity index 100% rename from resources_windows_amd64.syso rename to client/resources_windows_amd64.syso