1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-08-28 18:14:41 +08:00
parent 31fdb8af5a
commit d8310d576b
2 changed files with 12 additions and 13 deletions

View File

@ -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()
}
}
}},

View File

@ -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...)
}