mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-17 13:50:27 +00:00
21 lines
366 B
Go
21 lines
366 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
func executeSSH(path string, argv []string) error {
|
|
command := exec.Command(path, argv[1:]...)
|
|
command.Stdin = os.Stdin
|
|
command.Stdout = os.Stdout
|
|
command.Stderr = os.Stderr
|
|
err := command.Run()
|
|
var exitError *exec.ExitError
|
|
if errors.As(err, &exitError) {
|
|
os.Exit(exitError.ExitCode())
|
|
}
|
|
return err
|
|
}
|