mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-25 16:58:06 +08:00
add ssh.tool.option
This commit is contained in:
parent
de04fa3bee
commit
9a43ee0e40
@ -64,7 +64,7 @@ main() {
|
||||
trap HUP hup
|
||||
log "\nstarting..."
|
||||
while true; do
|
||||
date && ${ctx_bin} "$@" 2>${ctx_err} && break
|
||||
date && ${ctx_bin} "$@" 2>>${ctx_err} && break
|
||||
log "\n\nrestarting..." && sleep 1
|
||||
done
|
||||
}
|
||||
|
@ -147,6 +147,9 @@ func (m *Message) Detail(arg ...interface{}) string {
|
||||
return m.Insert("detail", index, arg...)
|
||||
}
|
||||
func (m *Message) Option(key string, arg ...interface{}) string {
|
||||
if m == nil {
|
||||
return ""
|
||||
}
|
||||
if len(arg) > 0 {
|
||||
m.Insert(key, 0, arg...)
|
||||
if _, ok := m.Meta[key]; ok {
|
||||
|
@ -350,6 +350,12 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
|
||||
msg.Option("river", arg[3])
|
||||
msg.Option("storm", arg[1])
|
||||
kit.Map(tool["inputs"], "", func(index int, value map[string]interface{}) {
|
||||
if name := kit.Format(value["name"]); name != "" {
|
||||
m.Log("info", "%v: %v", name, m.Option(name))
|
||||
msg.Option(name, m.Option(name))
|
||||
}
|
||||
})
|
||||
|
||||
arg = arg[4:]
|
||||
if len(prefix) > 0 && prefix[1] == "_" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user