diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-06-27 11:31:39 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-06-27 11:31:39 -0700 |
commit | ada2ea3a6b226cdf243b6b4243ffd62506a58d88 (patch) | |
tree | b3da33d8347da198f3343542d73ce475d2d64c4e | |
parent | 355cce3938a815feba1085569263ae0225cebfa6 (diff) | |
parent | c61440efea086ab5c9acb515604aac34d84b13cb (diff) | |
download | infinitytier-ada2ea3a6b226cdf243b6b4243ffd62506a58d88.tar.gz infinitytier-ada2ea3a6b226cdf243b6b4243ffd62506a58d88.zip |
Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into edge
-rw-r--r-- | make-linux.mk | 4 | ||||
-rw-r--r-- | osdep/OSUtils.cpp | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/make-linux.mk b/make-linux.mk index 5af8a92d..c27c600d 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -46,6 +46,10 @@ ifeq ($(ZT_SYNOLOGY), 1) DEFS+=-D__SYNOLOGY__ endif +ifeq ($(ZT_QNAP), 1) + DEFS+=-D__QNAP__ +endif + ifeq ($(ZT_TRACE),1) DEFS+=-DZT_TRACE endif diff --git a/osdep/OSUtils.cpp b/osdep/OSUtils.cpp index bf0dc04d..06508e77 100644 --- a/osdep/OSUtils.cpp +++ b/osdep/OSUtils.cpp @@ -363,6 +363,24 @@ std::vector<std::string> OSUtils::split(const char *s,const char *const sep,cons std::string OSUtils::platformDefaultHomePath() { +#ifdef __QNAP__ + char *cmd = "/sbin/getcfg ZeroTier Install_Path -f /etc/config/qpkg.conf"; + char buf[128]; + FILE *fp; + if ((fp = popen(cmd, "r")) == NULL) { + printf("Error opening pipe!\n"); + return NULL; + } + while (fgets(buf, 128, fp) != NULL) { } + if(pclose(fp)) { + printf("Command not found or exited with error status\n"); + return NULL; + } + std::string homeDir = std::string(buf); + homeDir.erase(std::remove(homeDir.begin(), homeDir.end(), '\n'), homeDir.end()); + return homeDir; +#endif + #ifdef __UNIX_LIKE__ #ifdef __APPLE__ |