Browse Source

Add special case for Ubiquiti routers in platformDefaultHomePath()

Joseph Henry 5 years ago
parent
commit
54f9f2ad53
2 changed files with 7 additions and 0 deletions
  1. 3 0
      make-linux.mk
  2. 4 0
      osdep/OSUtils.cpp

+ 3 - 0
make-linux.mk

@@ -85,6 +85,9 @@ endif
 ifeq ($(ZT_QNAP), 1)
         override DEFS+=-D__QNAP__
 endif
+ifeq ($(ZT_UBIQUITI), 1)
+        override DEFS+=-D__UBIQUITI__
+endif
 
 ifeq ($(ZT_SYNOLOGY), 1)
 	override CFLAGS+=-fPIC

+ 4 - 0
osdep/OSUtils.cpp

@@ -385,6 +385,10 @@ std::string OSUtils::platformDefaultHomePath()
     homeDir.erase(std::remove(homeDir.begin(), homeDir.end(), '\n'), homeDir.end());
     return homeDir;
 #endif
+#ifdef __UBIQUITI__
+	// Only persistent location after firmware upgrades
+	return std::string("/config/zerotier-one");
+#else
 
     // Check for user-defined environment variable before using defaults
 #ifdef __WINDOWS__