File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
client/internal/profilemanager Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,18 @@ func init() {
34
34
DefaultConfigPathDir = "/var/lib/netbird/"
35
35
oldDefaultConfigPathDir = "/etc/netbird/"
36
36
37
- switch runtime .GOOS {
38
- case "windows" :
39
- oldDefaultConfigPathDir = filepath .Join (os .Getenv ("PROGRAMDATA" ), "Netbird" )
40
- DefaultConfigPathDir = oldDefaultConfigPathDir
41
-
42
- case "freebsd" :
43
- oldDefaultConfigPathDir = "/var/db/netbird/"
44
- DefaultConfigPathDir = oldDefaultConfigPathDir
37
+ if stateDir := os .Getenv ("NB_STATE_DIR" ); stateDir != "" {
38
+ DefaultConfigPathDir = stateDir
39
+ } else {
40
+ switch runtime .GOOS {
41
+ case "windows" :
42
+ oldDefaultConfigPathDir = filepath .Join (os .Getenv ("PROGRAMDATA" ), "Netbird" )
43
+ DefaultConfigPathDir = oldDefaultConfigPathDir
44
+
45
+ case "freebsd" :
46
+ oldDefaultConfigPathDir = "/var/db/netbird/"
47
+ DefaultConfigPathDir = oldDefaultConfigPathDir
48
+ }
45
49
}
46
50
47
51
oldDefaultConfigPath = filepath .Join (oldDefaultConfigPathDir , "config.json" )
You can’t perform that action at this time.
0 commit comments