mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
cmd/cli: notice users where config file is written/read
This commit is contained in:
@@ -266,6 +266,9 @@ func initCLI() {
|
|||||||
{s.Uninstall, false},
|
{s.Uninstall, false},
|
||||||
{s.Install, false},
|
{s.Install, false},
|
||||||
{s.Start, true},
|
{s.Start, true},
|
||||||
|
// Note that startCmd do not actually write ControlD config, but the config file was
|
||||||
|
// generated after s.Start, so we notice users here for consistent with nextdns mode.
|
||||||
|
{noticeWritingControlDConfig, false},
|
||||||
}
|
}
|
||||||
mainLog.Load().Notice().Msg("Starting service")
|
mainLog.Load().Notice().Msg("Starting service")
|
||||||
if doTasks(tasks) {
|
if doTasks(tasks) {
|
||||||
@@ -1042,6 +1045,7 @@ func readConfigFile(writeDefaultConfig bool) bool {
|
|||||||
// If err == nil, there's a config supplied via `--config`, no default config written.
|
// If err == nil, there's a config supplied via `--config`, no default config written.
|
||||||
err := v.ReadInConfig()
|
err := v.ReadInConfig()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
mainLog.Load().Notice().Msg("Reading config: " + v.ConfigFileUsed())
|
||||||
mainLog.Load().Info().Msg("loading config file from: " + v.ConfigFileUsed())
|
mainLog.Load().Info().Msg("loading config file from: " + v.ConfigFileUsed())
|
||||||
defaultConfigFile = v.ConfigFileUsed()
|
defaultConfigFile = v.ConfigFileUsed()
|
||||||
return true
|
return true
|
||||||
@@ -1984,3 +1988,10 @@ func doGenerateNextDNSConfig(uid string) error {
|
|||||||
updateListenerConfig(&cfg)
|
updateListenerConfig(&cfg)
|
||||||
return writeConfigFile()
|
return writeConfigFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func noticeWritingControlDConfig() error {
|
||||||
|
if cdUID != "" {
|
||||||
|
mainLog.Load().Notice().Msgf("Generating controld config: %s", defaultConfigFile)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user