-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmodel_lin.go
35 lines (30 loc) · 959 Bytes
/
model_lin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package dev
import (
"time"
"github.com/udhos/jazigo/conf"
)
func registerModelLinux(logger hasPrintf, t *DeviceTable) {
a := conf.NewDevAttr()
a.NeedLoginChat = true
a.NeedEnabledMode = false
a.NeedPagingOff = false
a.EnableCommand = ""
a.UsernamePromptPattern = `Username:\s*$`
a.PasswordPromptPattern = `Password:\s*$`
a.EnablePasswordPromptPattern = ""
a.DisabledPromptPattern = `\$\s*$`
a.EnabledPromptPattern = `\$\s*$`
a.CommandList = []string{"", "/bin/uname -a", "/usr/bin/uptime", "/bin/ls"} // "" = dont send, wait for command prompt
a.DisablePagerCommand = ""
a.ReadTimeout = 5 * time.Second
a.MatchTimeout = 10 * time.Second
a.SendTimeout = 5 * time.Second
a.CommandReadTimeout = 10 * time.Second
a.CommandMatchTimeout = 10 * time.Second
a.QuoteSentCommandsFormat = `##[%s]`
m := &Model{name: "linux"}
m.defaultAttr = a
if err := t.SetModel(m, logger); err != nil {
logger.Printf("registerModelLinux: %v", err)
}
}