diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-05-20 19:38:49 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-05-20 19:38:49 -0700 |
commit | 12130739166895db88dca0c230f3972bd3ac3d6a (patch) | |
tree | ec5ce7cc4b2e804dcca69f874e58cb4f1aa6fbff /ext | |
parent | b6698d8415728a249426ee784fcbebfdfb8e4632 (diff) | |
download | infinitytier-12130739166895db88dca0c230f3972bd3ac3d6a.tar.gz infinitytier-12130739166895db88dca0c230f3972bd3ac3d6a.zip |
Apple auto-update stuff, now for Windows.
Diffstat (limited to 'ext')
-rwxr-xr-x | ext/installfiles/mac/postinst.sh | 6 | ||||
-rwxr-xr-x | ext/installfiles/mac/preinst.sh | 22 |
2 files changed, 18 insertions, 10 deletions
diff --git a/ext/installfiles/mac/postinst.sh b/ext/installfiles/mac/postinst.sh index 094eea48..7d3d516f 100755 --- a/ext/installfiles/mac/postinst.sh +++ b/ext/installfiles/mac/postinst.sh @@ -3,15 +3,11 @@ export PATH=/bin:/usr/bin:/sbin:/usr/sbin launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 -sleep 1 -killall zerotier-one -sleep 1 -killall -9 zerotier-one cd "/Library/Application Support/ZeroTier/One" rm -rf node.log node.log.old root-topology shutdownIfUnreadable autoupdate.log updates.d if [ ! -f authtoken.secret ]; then - head -c 1024 /dev/urandom | md5 | head -c 24 >authtoken.secret + head -c 4096 /dev/urandom | md5 | head -c 24 >authtoken.secret chown root authtoken.secret chgrp wheel authtoken.secret chmod 0600 authtoken.secret diff --git a/ext/installfiles/mac/preinst.sh b/ext/installfiles/mac/preinst.sh index 9fa50bef..c2cb494b 100755 --- a/ext/installfiles/mac/preinst.sh +++ b/ext/installfiles/mac/preinst.sh @@ -4,11 +4,23 @@ export PATH=/bin:/usr/bin:/sbin:/usr/sbin if [ -f /Library/LaunchDaemons/com.zerotier.one.plist ]; then launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 - sleep 1 - killall zerotier-one - sleep 1 - killall -9 zerotier-one fi -cd /Applications +sleep 1 + +if [ -d "/Library/Application Support/ZeroTier/One" ]; then + cd "/Library/Application Support/ZeroTier/One" + if [ -f "zerotier-one.pid" ]; then + ztpid=`cat zerotier-one.pid` + if [ "$ztpid" -gt "0" ]; then + kill `cat zerotier-one.pid` + fi + fi +fi + +sleep 1 + +cd "/Applications" rm -rf "ZeroTier One.app" + +exit 0 |