添加服务器ui调整

This commit is contained in:
linxiaozhi
2019-02-18 14:41:06 +08:00
parent 38e874a707
commit ad9dc965d6
4 changed files with 13 additions and 13 deletions

View File

@@ -272,20 +272,20 @@ func RemoteCommandJobByTelnetPassword(id int, name string, command string, serve
commandArr := strings.Split(command, "\n")
out := ""
out, n := "", 0
for _, c := range commandArr {
_, err = conn.Write([]byte(c + "\r\n"))
if err != nil {
return "", "", err, false
}
_, err = conn.Read(buf)
n, err = conn.Read(buf)
out = out + gbkAsUtf8(string(buf[:]))
out = out + gbkAsUtf8(string(buf[0:n]))
if err != nil ||
strings.Contains(out, "'"+c+"' is not recognized as an internal or external command") ||
strings.Contains(out, "'"+c+"' 不是内部或外部命令,也不是可运行的程序") {
return "", "", fmt.Errorf(gbkAsUtf8(string(buf[:]))), false
return out, "", fmt.Errorf(gbkAsUtf8(string(buf[0:n]))), false
}
}