forked from x/icebergs
opt boot
This commit is contained in:
parent
2538800449
commit
afec23c3a1
@ -52,7 +52,7 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
|
||||
// 启动信息
|
||||
m.Conf(RUNTIME, "boot.username", kit.Select(os.Getenv("USER"), os.Getenv("ctx_user")))
|
||||
if user, e := user.Current(); e == nil && user.Name != "" {
|
||||
m.Conf(RUNTIME, "boot.username", user.Name)
|
||||
m.Conf(RUNTIME, "boot.username", kit.Select(user.Name, os.Getenv("ctx_user")))
|
||||
}
|
||||
if name, e := os.Hostname(); e == nil {
|
||||
m.Conf(RUNTIME, "boot.hostname", kit.Select(name, os.Getenv("HOSTNAME")))
|
||||
|
@ -139,7 +139,7 @@ var Index = &ice.Context{Name: "docker", Help: "虚拟机",
|
||||
|
||||
p = path.Join(p, ".bashrc")
|
||||
if _, e := os.Stat(p); e != nil {
|
||||
m.Cmd(nfs.SAVE, p, kit.Format("export ctx_dev=%s\nexport ctx_pod=%s ctx_user=%s\n",
|
||||
m.Cmd(nfs.SAVE, p, kit.Format("export ctx_dev=%s export ctx_pod=%s ctx_user=%s\n",
|
||||
m.Conf(cli.RUNTIME, "conf.ctx_dev"), arg[0], cli.UserName))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user