2020-07-31 16:27:09 -04:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package dns
|
|
|
|
|
2021-04-01 23:26:52 -07:00
|
|
|
import "tailscale.com/types/logger"
|
|
|
|
|
2021-04-02 19:24:02 -07:00
|
|
|
func NewOSConfigurator(logf logger.Logf, _ string) OSConfigurator {
|
2020-07-31 16:27:09 -04:00
|
|
|
switch {
|
|
|
|
case isResolvconfActive():
|
2021-04-01 23:26:52 -07:00
|
|
|
return newResolvconfManager(logf)
|
2020-07-31 16:27:09 -04:00
|
|
|
default:
|
2021-04-01 23:26:52 -07:00
|
|
|
return newDirectManager()
|
2020-07-31 16:27:09 -04:00
|
|
|
}
|
|
|
|
}
|