2015-05-18 04:24:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-11-10 23:11:15 +00:00
|
|
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
2015-05-18 04:24:02 +00:00
|
|
|
|
|
|
|
launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1
|
|
|
|
|
|
|
|
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
|
2015-05-21 02:38:49 +00:00
|
|
|
head -c 4096 /dev/urandom | md5 | head -c 24 >authtoken.secret
|
2015-05-18 04:24:02 +00:00
|
|
|
chown root authtoken.secret
|
|
|
|
chgrp wheel authtoken.secret
|
|
|
|
chmod 0600 authtoken.secret
|
|
|
|
fi
|
2015-05-18 04:26:38 +00:00
|
|
|
rm -f zerotier-cli zerotier-idtool
|
|
|
|
ln -sf zerotier-one zerotier-cli
|
|
|
|
ln -sf zerotier-one zerotier-idtool
|
|
|
|
|
2015-11-10 23:11:15 +00:00
|
|
|
mkdir -p /usr/local/bin
|
|
|
|
cd /usr/local/bin
|
2015-05-18 04:26:38 +00:00
|
|
|
rm -f zerotier-cli zerotier-idtool
|
|
|
|
ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" zerotier-cli
|
|
|
|
ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" zerotier-idtool
|
2015-05-18 04:24:02 +00:00
|
|
|
|
|
|
|
launchctl load /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1
|
|
|
|
|
|
|
|
exit 0
|