mirror of
https://github.com/luscis/openlan.git
synced 2025-10-07 09:30:54 +08:00
fea: support route func for network (#53)
This commit is contained in:
@@ -347,3 +347,12 @@ func Exec(bin string, args ...string) (string, error) {
|
||||
out, err := exec.Command(bin, args...).CombinedOutput()
|
||||
return string(out), err
|
||||
}
|
||||
|
||||
func IsProcessRunning(pid int) bool {
|
||||
process, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
err = process.Signal(syscall.Signal(0))
|
||||
return err == nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user