diff options
| author | Josh Bleecher Snyder <josh@tailscale.com> | 2021-05-13 14:58:49 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-05-13 15:07:19 -0700 |
| commit | 6f62bbae7921452db4a7bb8e73e98abfe5db6ffd (patch) | |
| tree | eca077385f4f1e070c56e6f5a39e6dace7b7ef91 | |
| parent | 6fd4e8d244fe278e629052057af13e98ec161ccd (diff) | |
| download | tailscale-6f62bbae7921452db4a7bb8e73e98abfe5db6ffd.tar.xz tailscale-6f62bbae7921452db4a7bb8e73e98abfe5db6ffd.zip | |
cmd/tailscale: make ping --until-direct require direct connection to exit 0
If --until-direct is set, the goal is to make a direct connection.
If we failed at that, say so, and exit with an error.
RELNOTE=tailscale ping --until-direct (the default) now exits with
a non-zero exit code if no direct connection was established.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
| -rw-r--r-- | cmd/tailscale/cli/ping.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/tailscale/cli/ping.go b/cmd/tailscale/cli/ping.go index 3f08cc138..25470aa69 100644 --- a/cmd/tailscale/cli/ping.go +++ b/cmd/tailscale/cli/ping.go @@ -139,6 +139,9 @@ func runPing(ctx context.Context, args []string) error { if !anyPong { return errors.New("no reply") } + if pingArgs.untilDirect { + return errors.New("direct connection not established") + } return nil } } |
