MCPcopy Create free account
hub / github.com/Lifailon/ssh-bot / sshRunExecCommand

Method sshRunExecCommand

main.go:68–80  ·  view source on GitHub ↗
(command string, env *env.Env)

Source from the content-addressed store, hash-verified

66}
67
68func (ssh *SSH) sshRunExecCommand(command string, env *env.Env) ([]byte, error) {
69 output, err := exec.Command(
70 "ssh",
71 "-n",
72 "-o", "StrictHostKeyChecking=no",
73 "-o", "ConnectTimeout="+env.SSH_CONNECT_TIMEOUT,
74 ssh.SSH_USER+"@"+ssh.SSH_HOST,
75 "-p", ssh.SSH_PORT,
76 env.LINUX_SHELL, "-c",
77 "'"+command+"'",
78 ).CombinedOutput()
79 return output, err
80}
81
82// Run command via SSH
83func (ssh *SSH) sshRunCommand(command string, env *env.Env) ([]byte, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected