mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 00:06:38 +00:00
25 lines
405 B
Go
25 lines
405 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
|
|
"golang.zx2c4.com/wireguard/windows/elevate"
|
|
)
|
|
|
|
func main() {
|
|
argsWithoutProg := os.Args[1:]
|
|
op := func() error {
|
|
cmd := exec.Command(argsWithoutProg[0], argsWithoutProg[1:]...)
|
|
out, err := cmd.Output()
|
|
fmt.Println("")
|
|
fmt.Printf(string(out))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
fmt.Println(elevate.DoAsService("netbird", op))
|
|
}
|