This commit is contained in:
15
run_admin_linux.go
Normal file
15
run_admin_linux.go
Normal file
@@ -0,0 +1,15 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func runWithAdmin(exePath string, env []string) error {
|
||||
cmd := exec.Command("pkexec", exePath)
|
||||
cmd.Env = append(os.Environ(), env...)
|
||||
return cmd.Start()
|
||||
}
|
||||
Reference in New Issue
Block a user