Exemple #1
0
func (c *bootContext) cccHandler(output string) {
	// ./deblocus -ccc SERV_ADDR:PORT USER
	if flag.NArg() == 2 {
		addr := flag.Arg(0)
		v, err := t.IsValidHost(addr)
		fatalIf(!v, err)

		d5sc, err := t.Parse_d5s_file(c.config)
		fatalIf(err != nil, advice(err))

		d5sc.Listen = addr
		err = t.CreateClientConfig(output, d5sc, flag.Arg(1))
		fatalIf(err != nil, err)
	} else {
		fatal("Incorrect arguments")
	}
}
Exemple #2
0
func (c *bootContext) icc_process(output string) {
	defer func() {
		if e := recover(); e != nil {
			fmt.Println(e)
		}
	}()
	if flag.NArg() >= 2 {
		addr := flag.Arg(0)
		if v, e := t.IsValidHost(addr); !v {
			panic(e)
		}
		var d5sc = t.Parse_d5sFile(c.config)
		d5sc.Listen = addr
		for i, arg := range flag.Args() {
			if i > 0 {
				t.CreateClientCredential(output, d5sc, arg)
			}
		}
		return
	} else {
		fmt.Println("Which user do you issue client credential for?")
	}
}