mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
set up remote connserver (#245)
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/wavetermdev/thenextwave/pkg/wavebase"
|
||||
"github.com/wavetermdev/thenextwave/pkg/wshutil"
|
||||
"github.com/wavetermdev/thenextwave/pkg/wstore"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
type CommandOptsType struct {
|
||||
@@ -149,8 +150,7 @@ func (pp *PipePty) WriteString(s string) (n int, err error) {
|
||||
return pp.Write([]byte(s))
|
||||
}
|
||||
|
||||
func StartRemoteShellProc(termSize wstore.TermSize, cmdStr string, cmdOpts CommandOptsType, conn *remote.SSHConn) (*ShellProc, error) {
|
||||
client := conn.Client
|
||||
func StartRemoteShellProc(termSize wstore.TermSize, cmdStr string, cmdOpts CommandOptsType, client *ssh.Client) (*ShellProc, error) {
|
||||
shellPath, err := remote.DetectShell(client)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -195,6 +195,7 @@ func StartRemoteShellProc(termSize wstore.TermSize, cmdStr string, cmdOpts Comma
|
||||
}
|
||||
shellOpts = append(shellOpts, "-c", cmdStr)
|
||||
cmdCombined = fmt.Sprintf("%s %s", shellPath, strings.Join(shellOpts, " "))
|
||||
log.Printf("combined command is: %s", cmdCombined)
|
||||
}
|
||||
|
||||
session, err := client.NewSession()
|
||||
|
||||
Reference in New Issue
Block a user