@ -499,6 +499,7 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE
startLoginInteractive := func ( ) { loginOnce . Do ( func ( ) { localClient . StartLoginInteractive ( ctx ) } ) }
startLoginInteractive := func ( ) { loginOnce . Do ( func ( ) { localClient . StartLoginInteractive ( ctx ) } ) }
go func ( ) {
go func ( ) {
var cv * tailcfg . ClientVersion
for {
for {
n , err := watcher . Next ( )
n , err := watcher . Next ( )
if err != nil {
if err != nil {
@ -509,6 +510,9 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE
msg := * n . ErrMessage
msg := * n . ErrMessage
fatalf ( "backend error: %v\n" , msg )
fatalf ( "backend error: %v\n" , msg )
}
}
if n . ClientVersion != nil {
cv = n . ClientVersion
}
if s := n . State ; s != nil {
if s := n . State ; s != nil {
switch * s {
switch * s {
case ipn . NeedsLogin :
case ipn . NeedsLogin :
@ -527,6 +531,11 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE
} else if printed {
} else if printed {
// Only need to print an update if we printed the "please click" message earlier.
// Only need to print an update if we printed the "please click" message earlier.
fmt . Fprintf ( Stderr , "Success.\n" )
fmt . Fprintf ( Stderr , "Success.\n" )
if cv != nil && ! cv . RunningLatest && cv . LatestVersion != "" {
fmt . Fprintf ( Stderr , "\nUpdate available: %v -> %v\n" , version . Short ( ) , cv . LatestVersion )
fmt . Fprintln ( Stderr , "Changelog: https://tailscale.com/changelog/#client" )
fmt . Fprintln ( Stderr , "Run `tailscale update` or `tailscale set --auto-update` to update" )
}
}
}
select {
select {
case running <- true :
case running <- true :