Exemplo n.º 1
0
func configForIndex(idx *shells.Indexsh, c *api.Context,
	fname string) (err error) {
	var data []byte

	idx.ConfigFile = fname
	if data, err = ioutil.ReadFile(fname); err == nil {
		err = json.Unmarshal(data, &idx.Config)
	}
	idx.Killall(c)
	if err == nil {
		fmt.Fprintf(c.W, "Loaded config %q ...\n", idx.ConfigFile)
	}
	return
}
Exemplo n.º 2
0
func runProgram(idx *shells.Indexsh, c *api.Context, name string) {
	p := sshc.RunProgram(name, idx.Config)
	idx.Programs[name] = p
	go idx.GetLog(p, c)
}