forked from x/icebergs
fix ssh.scan repeat
This commit is contained in:
parent
8765fe3187
commit
571d6d1f6c
@ -11,6 +11,7 @@ import (
|
|||||||
"os/user"
|
"os/user"
|
||||||
"path"
|
"path"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Index = &ice.Context{Name: "cli", Help: "命令模块",
|
var Index = &ice.Context{Name: "cli", Help: "命令模块",
|
||||||
@ -45,7 +46,12 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
|
|||||||
m.Cmd(ice.AAA_ROLE, "root", m.Conf(ice.CLI_RUNTIME, "boot.username"))
|
m.Cmd(ice.AAA_ROLE, "root", m.Conf(ice.CLI_RUNTIME, "boot.username"))
|
||||||
}
|
}
|
||||||
if name, e := os.Getwd(); e == nil {
|
if name, e := os.Getwd(); e == nil {
|
||||||
m.Conf(ice.CLI_RUNTIME, "boot.pathname", path.Base(kit.Select(name, os.Getenv("PWD"))))
|
name = path.Base(kit.Select(name, os.Getenv("PWD")))
|
||||||
|
ls := strings.Split(name, "/")
|
||||||
|
name = ls[len(ls)-1]
|
||||||
|
ls = strings.Split(name, "\\")
|
||||||
|
name = ls[len(ls)-1]
|
||||||
|
m.Conf(ice.CLI_RUNTIME, "boot.pathname", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 启动记录
|
// 启动记录
|
||||||
|
@ -92,10 +92,7 @@ func (f *Frame) parse(m *ice.Message, line string) *Frame {
|
|||||||
|
|
||||||
// 执行命令
|
// 执行命令
|
||||||
msg := m.Spawns(f.target)
|
msg := m.Spawns(f.target)
|
||||||
if msg.Cmdy(ls[0], ls[1:]); !msg.Hand {
|
msg.Cmdy(ls[0], ls[1:])
|
||||||
// 系统命令
|
|
||||||
msg = msg.Set("result").Cmdy(ice.CLI_SYSTEM, ls)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 转换结果
|
// 转换结果
|
||||||
res := msg.Result()
|
res := msg.Result()
|
||||||
|
@ -415,7 +415,8 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
"timeout.c", "30s",
|
"timeout.c", "30s",
|
||||||
)},
|
)},
|
||||||
ice.WEB_DREAM: {Name: "dream", Help: "梦想家", Value: kit.Data("path", "usr/local/work",
|
ice.WEB_DREAM: {Name: "dream", Help: "梦想家", Value: kit.Data("path", "usr/local/work",
|
||||||
"cmd", []interface{}{ice.CLI_SYSTEM, "ice.sh", "start", ice.WEB_SPACE, "connect"},
|
// "cmd", []interface{}{ice.CLI_SYSTEM, "ice.sh", "start", ice.WEB_SPACE, "connect"},
|
||||||
|
"cmd", []interface{}{ice.CLI_SYSTEM, "ice.bin", ice.WEB_SPACE, "connect"},
|
||||||
)},
|
)},
|
||||||
|
|
||||||
ice.WEB_FAVOR: {Name: "favor", Help: "收藏夹", Value: kit.Data(kit.MDB_SHORT, kit.MDB_NAME)},
|
ice.WEB_FAVOR: {Name: "favor", Help: "收藏夹", Value: kit.Data(kit.MDB_SHORT, kit.MDB_NAME)},
|
||||||
|
3
type.go
3
type.go
@ -1458,8 +1458,7 @@ func (m *Message) Cmd(arg ...interface{}) *Message {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if m.Warn(m.Hand == false, "not found %v", list) {
|
if m.Warn(m.Hand == false, "not found %v", list) {
|
||||||
m.Cmdy(CLI_SYSTEM, list)
|
return m.Set(MSG_RESULT).Cmd(CLI_SYSTEM, list)
|
||||||
m.Hand = true
|
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user