mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-02-07 02:07:05 +00:00
refactor: yeet util/ subdirs
This commit is contained in:
parent
b6ae95f55b
commit
62578ad5c5
13 changed files with 10 additions and 10 deletions
12
sshsession/session.go
Normal file
12
sshsession/session.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue