diff options
Diffstat (limited to 'ext/installfiles/mac/postinst.sh')
| -rwxr-xr-x | ext/installfiles/mac/postinst.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/installfiles/mac/postinst.sh b/ext/installfiles/mac/postinst.sh new file mode 100755 index 00000000..7d3d516f --- /dev/null +++ b/ext/installfiles/mac/postinst.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +export PATH=/bin:/usr/bin:/sbin:/usr/sbin + +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 + head -c 4096 /dev/urandom | md5 | head -c 24 >authtoken.secret + chown root authtoken.secret + chgrp wheel authtoken.secret + chmod 0600 authtoken.secret +fi +rm -f zerotier-cli zerotier-idtool +ln -sf zerotier-one zerotier-cli +ln -sf zerotier-one zerotier-idtool + +cd /usr/bin +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 + +launchctl load /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 + +exit 0 |
