ACN Process Management #345
|
@ -22,7 +22,7 @@ func CheckProcessAndKill(pid uint64, processName string) {
|
|||
// process.exe <PID> Services 0 8,936 K
|
||||
lines := strings.Split(string(bytes),"\n")
|
||||
// check for "<process>.exe"
|
||||
if len(lines) >= 3 && strings.HasPrefix(strings.ToLower(strings.Trim(lines[2])),processName+".exe") {
|
||||
if len(lines) >= 3 && strings.HasPrefix(strings.ToLower(strings.TrimSpace(lines[2])),processName+".exe") {
|
||||
Kill(pid)
|
||||
return
|
||||
}
|
||||
|
@ -43,4 +43,4 @@ func Kill(pid uint64) {
|
|||
log.Debugf("could not kill pid: %v %v", pid, err)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue