mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-28 18:46:43 +00:00
Add api command
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user