mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-21 01:36:46 +00:00
test windows 2019
This commit is contained in:
24
testutil/runassystem.go
Normal file
24
testutil/runassystem.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user