diff --git a/base/cli/forever.go b/base/cli/forever.go index e1ff5439..1363d73b 100644 --- a/base/cli/forever.go +++ b/base/cli/forever.go @@ -38,10 +38,10 @@ func init() { m.Cmd(FOREVER, STOP) if len(arg) > 0 && arg[0] == "space" { - m.Cmdy(FOREVER, kit.Select(os.Args[0], nfs.PWD+ice.BIN_ICE_BIN, nfs.ExistsFile(m, ice.BIN_ICE_BIN)), + m.Cmdy(FOREVER, kit.Select(os.Args[0], ice.BIN_ICE_BIN, nfs.ExistsFile(m, ice.BIN_ICE_BIN)), "space", "dial", ice.DEV, ice.OPS, arg[2:]) } else { - m.Cmdy(FOREVER, kit.Select(os.Args[0], nfs.PWD+ice.BIN_ICE_BIN, nfs.ExistsFile(m, ice.BIN_ICE_BIN)), + m.Cmdy(FOREVER, kit.Select(os.Args[0], ice.BIN_ICE_BIN, nfs.ExistsFile(m, ice.BIN_ICE_BIN)), "serve", START, ice.DEV, "", aaa.USERNAME, aaa.ROOT, aaa.PASSWORD, aaa.ROOT, arg) } }}, @@ -64,12 +64,7 @@ func init() { logs.Println(ice.EXIT) // 正常退出 break } else { - if logs.Println(); nfs.ExistsFile(m, "var/log/bench.log") { - nfs.Rename(m, "var/log/bench.log", kit.Format("var/log/bench.%s.log", logs.Now().Format("20060102-150405"))) - } - if logs.Println(); nfs.ExistsFile(m, "var/log/error.log") { - nfs.Rename(m, "var/log/error.log", kit.Format("var/log/error.%s.log", logs.Now().Format("20060102-150405"))) - } + logs.Println() } } }}, diff --git a/base/web/option.go b/base/web/option.go index ffd52999..067e487e 100644 --- a/base/web/option.go +++ b/base/web/option.go @@ -115,7 +115,11 @@ func PushPodCmd(m *ice.Message, cmd string, arg ...string) { }) } -func OptionAgentIs(m *ice.Message, arg ...string) bool { +type Message interface { + Option(key string, arg ...ice.Any) string +} + +func OptionAgentIs(m Message, arg ...string) bool { for _, k := range arg { if strings.HasPrefix(m.Option(ice.MSG_USERUA), k) { return true @@ -123,15 +127,15 @@ func OptionAgentIs(m *ice.Message, arg ...string) bool { } return false } -func OptionUserWeb(m *ice.Message) *url.URL { +func OptionUserWeb(m Message) *url.URL { return kit.ParseURL(m.Option(ice.MSG_USERWEB)) } -func MergeURL2(m *ice.Message, url string, arg ...ice.Any) string { +func MergeURL2(m Message, url string, arg ...ice.Any) string { return kit.MergeURL2(m.Option(ice.MSG_USERWEB), url, arg...) } -func MergeLink(m *ice.Message, url string, arg ...ice.Any) string { +func MergeLink(m Message, url string, arg ...ice.Any) string { return strings.Split(MergeURL2(m, url, arg...), "?")[0] } -func MergePod(m *ice.Message, pod string, arg ...ice.Any) string { +func MergePod(m Message, pod string, arg ...ice.Any) string { return kit.MergePOD(kit.Select(ice.Info.Domain, m.Option(ice.MSG_USERWEB)), pod, arg...) }