mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
add shell to initpk
This commit is contained in:
@@ -576,6 +576,7 @@ type InitPacketType struct {
|
||||
HostName string `json:"hostname,omitempty"`
|
||||
NotFound bool `json:"notfound,omitempty"`
|
||||
UName string `json:"uname,omitempty"`
|
||||
Shell string `json:"shell,omitempty"`
|
||||
RemoteId string `json:"remoteid,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ const MinMaxPtySize = 16 * 1024
|
||||
const MaxMaxPtySize = 100 * 1024 * 1024
|
||||
const MaxRunDataSize = 1024 * 1024
|
||||
const MaxTotalRunDataSize = 10 * MaxRunDataSize
|
||||
const ShellVarName = "SHELL"
|
||||
|
||||
const GetStateTimeout = 5 * time.Second
|
||||
|
||||
@@ -1432,6 +1433,7 @@ func MakeServerInitPacket() (*packet.InitPacketType, error) {
|
||||
return nil, err
|
||||
}
|
||||
initPacket.State = shellState
|
||||
initPacket.Shell = os.Getenv(ShellVarName)
|
||||
initPacket.RemoteId, err = base.GetRemoteId()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user