title: Bash Shell: How can I know if TeamViewer has disconnected?
body: <p>Sometimes <strong>TeamViewer disconnects</strong> itself (or gets disconnected) from its internet's main servers.  </p>
  
  <p>I am programming a script that will check if connection is lost and, if yes, kills and reopens the concerned process to <strong>make TeamViewer up and running</strong> again.  </p>
  
  <p>The <strong>problem</strong> is: I don't know how to <strong>discover</strong> that TeamViewer has lost its remote access capability (this is: the capability to be remotely accessed and controlled).  </p>
  
  <p><strong>Tested</strong> until now:  </p>
  
  <ul>
  <li>Check TeamViewer process and/or daemon. Not valid: they keep working even after disconnected.</li>
  <li>NICs review. Not valid: TeamViewer seems not to add any.</li>
  <li>See the TeamViewer's main window. Not programmatically valid or easy to implement.</li>
  </ul>
  
  <p>How can I <strong>programmatically know if TeamViewer has disconnected</strong>?  </p>
  
  <p>I don't know if this method differs between platforms, but at least I would like to know about a solution for some Linux shell. Bash if possible.</p>