Review cgr-console to work in batch mode

This commit is contained in:
TeoV
2019-03-07 08:59:57 +02:00
committed by Dan Christian Bogos
parent b5ad475434
commit c6ede2898e

View File

@@ -129,12 +129,12 @@ func main() {
client, err = rpcclient.NewRpcClient("tcp", *server, *tls, *keyPath, *certificatePath, *caPath, 3, 3,
time.Duration(1*time.Second), time.Duration(5*time.Minute), strings.TrimPrefix(*rpcEncoding, utils.Meta), nil, false)
if err != nil {
flag.PrintDefaults()
cgrConsoleFlags.PrintDefaults()
log.Fatal("Could not connect to server " + *server)
}
if len(flag.Args()) != 0 {
executeCommand(strings.Join(flag.Args(), " "))
if len(cgrConsoleFlags.Args()) != 0 {
executeCommand(strings.Join(cgrConsoleFlags.Args(), " "))
return
}