From 26ed8a9b5752e887067582aeb53e8d4d0c95eaaf Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 14 Mar 2019 12:56:03 +0800 Subject: [PATCH] Update __init__.py --- route/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/route/__init__.py b/route/__init__.py index debdd4555..9e541219e 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -314,6 +314,12 @@ def connected_msg(msg): emit(pdata.s_response, {'data': '会话丢失,请重新登陆面板!\r\n'}) return None global shell, ssh + ssh_success = True + if not shell: + ssh_success = connect_ssh() + if not ssh_success: + emit('server_response', {'data': '连接SSH服务失败!\r\n'}) + return try: recv = shell.recv(8192) # print recv.decode("utf-8")