From 8fda2f2b3d5379aea2a4a08350ed8090179ee851 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 9 Jul 2024 17:03:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BD=91=E5=85=83=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=91=BD=E4=BB=A4=E7=BB=88=E6=AD=A2=E7=AC=A6?= =?UTF-8?q?=E5=88=A4=E6=96=AD#$?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/network_element/service/ne_version.impl.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/network_element/service/ne_version.impl.go b/src/modules/network_element/service/ne_version.impl.go index da2dbfed..2632ec33 100644 --- a/src/modules/network_element/service/ne_version.impl.go +++ b/src/modules/network_element/service/ne_version.impl.go @@ -558,7 +558,8 @@ func (r *NeVersionImpl) operateRun(sshClient *ssh.ConnSSH, preinput map[string]s } // 命令终止符后继续执行命令 - if len(cmdStrArr) > 0 && strings.LastIndex(outputStr, "~$ ") > 2 { + suffix := strings.HasSuffix(outputStr, "~]# ") || strings.HasSuffix(outputStr, "~$ ") + if len(cmdStrArr) > 0 && suffix { if firstRead { firstRead = false }