diff --git a/cmd/tailscale/cli/status.go b/cmd/tailscale/cli/status.go index d70463b8f..a414e95d5 100644 --- a/cmd/tailscale/cli/status.go +++ b/cmd/tailscale/cli/status.go @@ -25,6 +25,7 @@ import ( "tailscale.com/net/interfaces" "tailscale.com/util/cmpx" "tailscale.com/util/dnsname" + "tailscale.com/version" ) var statusCmd = &ffcli.Command{ @@ -237,7 +238,7 @@ func runStatus(ctx context.Context, args []string) error { } printFunnelStatus(ctx) if cv := st.ClientVersion; cv != nil && !cv.RunningLatest && cv.LatestVersion != "" { - printf("# New Tailscale version is available: %q, run `tailscale update` to update.\n", cv.LatestVersion) + printf("# Update available: %v -> %v, run `tailscale update` or `tailscale set --auto-update` to update.\n", version.Short(), cv.LatestVersion) } return nil } diff --git a/cmd/tailscale/cli/up.go b/cmd/tailscale/cli/up.go index 1ff498214..850a56cf2 100644 --- a/cmd/tailscale/cli/up.go +++ b/cmd/tailscale/cli/up.go @@ -499,6 +499,7 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE startLoginInteractive := func() { loginOnce.Do(func() { localClient.StartLoginInteractive(ctx) }) } go func() { + var cv *tailcfg.ClientVersion for { n, err := watcher.Next() if err != nil { @@ -509,6 +510,9 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE msg := *n.ErrMessage fatalf("backend error: %v\n", msg) } + if n.ClientVersion != nil { + cv = n.ClientVersion + } if s := n.State; s != nil { switch *s { case ipn.NeedsLogin: @@ -527,6 +531,11 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE } else if printed { // Only need to print an update if we printed the "please click" message earlier. 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 { case running <- true: