1
0

feat: 合并代码

This commit is contained in:
TsMask
2024-01-12 15:54:24 +08:00
parent 3cec6077d3
commit 94392e13fd
52 changed files with 1962 additions and 191 deletions

View File

@@ -70,6 +70,10 @@ func (s *TcpdumpController) NeTask(c *gin.Context) {
c.JSON(200, result.ErrMsg(err.Error()))
return
}
if strings.Contains(msg, "command not found") {
c.JSON(200, result.ErrMsg("Command [tcpdump] Not Found"))
return
}
c.JSON(200, result.OkData(map[string]any{
"cmd": cmdStr,
@@ -211,6 +215,14 @@ func (s *TcpdumpController) NeUPFTask(c *gin.Context) {
c.JSON(200, result.ErrMsg(err.Error()))
return
}
if strings.Contains(msg, "command not found") {
c.JSON(200, result.ErrMsg("Command [expect] Not Found"))
return
}
if strings.Contains(msg, "Unable to connect to remote host") {
c.JSON(200, result.ErrMsg("Connection Refused"))
return
}
s := strings.Index(msg, "pcap dispatch trace:")
if s != -1 {
e := strings.Index(msg, "\r\nupfd1#")
@@ -243,6 +255,14 @@ func (s *TcpdumpController) NeUPFTask(c *gin.Context) {
c.JSON(200, result.ErrMsg(err.Error()))
return
}
if strings.Contains(msg, "command not found") {
c.JSON(200, result.ErrMsg("Command [expect] Not Found"))
return
}
if strings.Contains(msg, "Unable to connect to remote host") {
c.JSON(200, result.ErrMsg("Connection Refused"))
return
}
s := strings.Index(msg, "pcap dispatch trace:")
if s == -1 {
s = strings.Index(msg, "Write ")