-shareexists: test for connection-sharing upstream

PuTTY

7.2.3.3 -shareexists: test for connection-sharing upstream

This option does not make a new connection; instead it allows testing for the presence of an existing connection that can be shared. (See section 4.18.5 for more information about SSH connection sharing.)

A Plink invocation of the form:

plink -shareexists <session>

will test whether there is currently a viable ‘upstream’ for the session in question, which can be specified using any syntax you'd normally use with Plink to make an actual connection (a host/port number, a bare saved session name, -load, etc). It returns a zero exit status if a usable ‘upstream’ exists, nonzero otherwise.

(This option is only meaningful with the SSH-2 protocol.)