summaryrefslogtreecommitdiff
path: root/installer.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-11-08 17:37:47 -0500
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-11-08 17:37:47 -0500
commit165bc589fdb5e8d3dd03f2e6030172629eb07ded (patch)
tree58ec05cbf924844461d168784250be7e9a0edef7 /installer.cpp
parent15375ef6b9a0bf7ae2473a893816c4916d9ab7ba (diff)
downloadinfinitytier-165bc589fdb5e8d3dd03f2e6030172629eb07ded.tar.gz
infinitytier-165bc589fdb5e8d3dd03f2e6030172629eb07ded.zip
Linux install and uninstall seem to work.
Diffstat (limited to 'installer.cpp')
-rw-r--r--installer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/installer.cpp b/installer.cpp
index 0bc911dc..a2165597 100644
--- a/installer.cpp
+++ b/installer.cpp
@@ -90,7 +90,7 @@
static unsigned char *_unlz4(const void *lz4,int decompressedLen)
{
unsigned char *buf = new unsigned char[decompressedLen];
- if (LZ4_decompress_fast((const char *)lz4,(char *)buf,decompressedLen) != decompressedLen) {
+ if (LZ4_decompress_fast((const char *)lz4,(char *)buf,decompressedLen) <= 0) {
delete [] buf;
return (unsigned char *)0;
}
@@ -173,6 +173,10 @@ int main(int argc,char **argv)
chown(buf,0,0);
printf("write %s\n",buf);
+ unlink("/usr/bin/zerotier-cli");
+ symlink(buf,"/usr/bin/zerotier-cli");
+ printf("link %s /usr/bin/zerotier-cli\n",buf);
+
sprintf(buf,"%s/uninstall.sh",zthome);
if (!putBlob(uninstall_sh,buf)) {
printf("! unable to write %s\n",buf);
@@ -236,6 +240,8 @@ int main(int argc,char **argv)
printf("link /etc/init.d/zerotier-one /etc/rc4.d/S11zerotier-one\n");
symlink("/etc/init.d/zerotier-one","/etc/rc5.d/S11zerotier-one");
printf("link /etc/init.d/zerotier-one /etc/rc5.d/S11zerotier-one\n");
+ symlink("/etc/init.d/zerotier-one","/etc/rc6.d/S11zerotier-one");
+ printf("link /etc/init.d/zerotier-one /etc/rc6.d/S11zerotier-one\n");
#endif
printf("# Done!\n");