diff options
-rw-r--r-- | cmd/gobgpd/main.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go index ab42e71b..68ea0cac 100644 --- a/cmd/gobgpd/main.go +++ b/cmd/gobgpd/main.go @@ -122,8 +122,8 @@ func main() { log.SetFormatter(&log.JSONFormatter{}) } - configCh := make(chan *internal_cfg.BgpConfigSet) if opts.Dry { + configCh := make(chan *internal_cfg.BgpConfigSet) go internal_cfg.ReadConfigfileServe(opts.ConfigFile, opts.ConfigType, configCh) c := <-configCh if opts.LogLevel == "debug" { @@ -156,10 +156,14 @@ func main() { } } - if opts.ConfigFile != "" { - go internal_cfg.ReadConfigfileServe(opts.ConfigFile, opts.ConfigType, configCh) + if opts.ConfigFile == "" { + <-sigCh + stopServer(bgpServer, opts.UseSdNotify) + return } + configCh := make(chan *internal_cfg.BgpConfigSet) + go internal_cfg.ReadConfigfileServe(opts.ConfigFile, opts.ConfigType, configCh) loop := func() { initialConfig := <-configCh c := config.ApplyInitialConfig(bgpServer, initialConfig, opts.GracefulRestart) |