paths: update some default paths for darwin

This commit is contained in:
Brad Fitzpatrick 2021-02-13 12:10:20 -08:00
parent 20e66c5b92
commit 54e108ff4e
2 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,9 @@ func DefaultTailscaledSocket() string {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
return "" return ""
} }
if runtime.GOOS == "darwin" {
return "/var/run/tailscaled.socket"
}
if fi, err := os.Stat("/var/run"); err == nil && fi.IsDir() { if fi, err := os.Stat("/var/run"); err == nil && fi.IsDir() {
return "/var/run/tailscale/tailscaled.sock" return "/var/run/tailscale/tailscaled.sock"
} }

View File

@ -23,6 +23,8 @@ func statePath() string {
return "/var/lib/tailscale/tailscaled.state" return "/var/lib/tailscale/tailscaled.state"
case "freebsd", "openbsd": case "freebsd", "openbsd":
return "/var/db/tailscale/tailscaled.state" return "/var/db/tailscale/tailscaled.state"
case "darwin":
return "/Library/Tailscale/tailscaled.state"
default: default:
return "" return ""
} }