|
@@ -31,25 +31,14 @@ var (
|
|
|
WifiNetworks []string
|
|
WifiNetworks []string
|
|
|
HttpOpen = false
|
|
HttpOpen = false
|
|
|
UploadSecret string
|
|
UploadSecret string
|
|
|
|
|
+ BasePath = "/opt/nativeplanet/groundseg"
|
|
|
checkInterval = 5 * time.Minute
|
|
checkInterval = 5 * time.Minute
|
|
|
- stagingMode = os.Getenv("ENVIRONMENT")
|
|
|
|
|
confMutex sync.Mutex
|
|
confMutex sync.Mutex
|
|
|
versMutex sync.Mutex
|
|
versMutex sync.Mutex
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// try initializing from system.json on disk
|
|
// try initializing from system.json on disk
|
|
|
func init() {
|
|
func init() {
|
|
|
- // try loading existing config
|
|
|
|
|
- BasePath, err := os.Getwd()
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- errmsg := fmt.Sprintf("Couldn't get cwd: %v", err)
|
|
|
|
|
- logger.Error(errmsg)
|
|
|
|
|
- }
|
|
|
|
|
- for _, arg := range os.Args[1:] {
|
|
|
|
|
- if arg == "dev" {
|
|
|
|
|
- BasePath = "/opt/nativeplanet/groundseg"
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
pathMsg := fmt.Sprintf("Loading configs from %s", BasePath)
|
|
pathMsg := fmt.Sprintf("Loading configs from %s", BasePath)
|
|
|
logger.Info(pathMsg)
|
|
logger.Info(pathMsg)
|
|
|
confPath := filepath.Join(BasePath, "settings", "system.json")
|
|
confPath := filepath.Join(BasePath, "settings", "system.json")
|