mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-04 09:51:16 +01:00
17 lines
422 B
Go
17 lines
422 B
Go
package statemanager
|
|
|
|
import (
|
|
"github.com/netbirdio/netbird/client/configs"
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// GetDefaultStatePath returns the path to the state file based on the operating system
|
|
// It returns an empty string if the path cannot be determined.
|
|
func GetDefaultStatePath() string {
|
|
if path := os.Getenv("NB_DNS_STATE_FILE"); path != "" {
|
|
return path
|
|
}
|
|
return filepath.Join(configs.StateDir, "state.json")
|
|
}
|