mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-07 22:10:12 +01:00
522dd44bfa
- NB_STATE_DIR - NB_UNCLEAN_SHUTDOWN_RESOLV_FILE - NB_DNS_STATE_FILE
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")
|
|
}
|