Compare commits
2 Commits
d48afc61af
...
8bb1e4d0a2
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bb1e4d0a2 | |||
| 9590de2e00 |
@ -9,6 +9,7 @@ import (
|
||||
"os/exec"
|
||||
"path"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func copy(src, dst string) error {
|
||||
@ -63,11 +64,20 @@ func main() {
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
proc, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
|
||||
for {
|
||||
stdlog.Println("wait for terminating of", args[3])
|
||||
proc, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
state, _ := proc.Wait()
|
||||
if state == nil {
|
||||
break
|
||||
}
|
||||
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
proc.Wait()
|
||||
|
||||
selfext, _ := os.Executable()
|
||||
selfext = path.Base(selfext)
|
||||
|
||||
Reference in New Issue
Block a user