프로세스 종료시 알림

This commit is contained in:
2023-11-24 00:19:17 +09:00
parent d18fe3e3a1
commit 1a404e5361
9 changed files with 171 additions and 54 deletions

View File

@ -1,21 +0,0 @@
//go:build client && linux
package client
import (
"os"
"os/exec"
)
func init() {
file, _ := os.OpenFile("setcap.sh", os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0777)
file.Write([]byte("sudo setcap 'cap_net_bind_service=+ep' $1"))
file.Sync()
file.Close()
}
func set_permission(path string) error {
os.Chmod(path, 0777)
cmd := exec.Command("/bin/bash", "./setcap.sh", path)
return cmd.Run()
}