mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 13:21:01 +00:00
12 lines
240 B
Go
12 lines
240 B
Go
package sshsession
|
|
|
|
import "golang.org/x/crypto/ssh"
|
|
|
|
func Run(client *ssh.Client, cmd string) ([]byte, error) {
|
|
sess, err := client.NewSession()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
defer sess.Close()
|
|
return sess.CombinedOutput(cmd)
|
|
}
|