fix: 网元版本安装命令终止符判断#$

This commit is contained in:
TsMask
2024-07-09 17:03:46 +08:00
parent b1ca797266
commit 8fda2f2b3d

View File

@@ -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
}