Skip to content

Commit

Permalink
home: fix conf symlink usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Mar 27, 2024
1 parent 2611534 commit 5476625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions internal/home/home.go
Expand Up @@ -539,13 +539,13 @@ func fatalOnError(err error) {

// run configures and starts AdGuard Home.
func run(opts options, clientBuildFS fs.FS, done chan struct{}) {
// Configure config filename.
initConfigFilename(opts)

// Configure working dir and config path.
// Configure working dir.
err := initWorkingDir(opts)
fatalOnError(err)

// Configure config filename.
initConfigFilename(opts)

// Configure log level and output.
err = configureLogger(opts)
fatalOnError(err)
Expand Down Expand Up @@ -764,7 +764,7 @@ func writePIDFile(fn string) bool {
func initConfigFilename(opts options) {
confPath := opts.confFilename
if confPath == "" {
Context.confFilePath = "AdGuardHome.yaml"
Context.confFilePath = filepath.Join(Context.workDir, "AdGuardHome.yaml")

return
}
Expand Down
2 changes: 1 addition & 1 deletion internal/home/service.go
Expand Up @@ -271,10 +271,10 @@ func handleServiceCommand(s service.Service, action string, opts options) (err e
return fmt.Errorf("failed to run service: %w", err)
}
case "install":
initConfigFilename(opts)
if err = initWorkingDir(opts); err != nil {
return fmt.Errorf("failed to init working dir: %w", err)
}
initConfigFilename(opts)

handleServiceInstallCommand(s)
case "uninstall":
Expand Down

0 comments on commit 5476625

Please sign in to comment.