diff --git a/packages/sshnpdpy/lib/sshnpdclient.py b/packages/sshnpdpy/lib/sshnpdclient.py index 7ca8ea49c..5ba70e14f 100644 --- a/packages/sshnpdpy/lib/sshnpdclient.py +++ b/packages/sshnpdpy/lib/sshnpdclient.py @@ -64,11 +64,11 @@ def start(self): def is_alive(self): if not self.authenticated: - return False - elif len(SSHNPDClient.threads) > 2: - return False - else: return True + elif len(SSHNPDClient.threads) >= 2 and self.ssh_client.get_transport().is_active(): + return True + else: + return False def join(self): self.closing.set() diff --git a/packages/sshnpdpy/sshnpd.py b/packages/sshnpdpy/sshnpd.py index b4257177e..e995542ec 100644 --- a/packages/sshnpdpy/sshnpd.py +++ b/packages/sshnpdpy/sshnpd.py @@ -30,6 +30,7 @@ def main(): except Exception as e: print(e) + sshnpd.join() if __name__ == "__main__":