Add set_system_proxy for linux and android

This commit is contained in:
世界
2022-07-14 20:30:57 +08:00
parent de2db7c2d2
commit b9086b31e6
12 changed files with 182 additions and 47 deletions

View File

@@ -0,0 +1,19 @@
package settings
import (
"os"
"os/exec"
"strings"
"github.com/sagernet/sing-box/log"
)
func runCommand(name string, args ...string) error {
log.Debug(name, " ", strings.Join(args, " "))
command := exec.Command(name, args...)
command.Env = os.Environ()
command.Stdin = os.Stdin
command.Stdout = os.Stderr
command.Stderr = os.Stderr
return command.Run()
}