postinst.sh 859 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  3. launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1
  4. cd "/Library/Application Support/ZeroTier/One"
  5. rm -rf node.log node.log.old root-topology shutdownIfUnreadable autoupdate.log updates.d
  6. if [ ! -f authtoken.secret ]; then
  7. head -c 4096 /dev/urandom | md5 | head -c 24 >authtoken.secret
  8. chown root authtoken.secret
  9. chgrp wheel authtoken.secret
  10. chmod 0600 authtoken.secret
  11. fi
  12. rm -f zerotier-cli zerotier-idtool
  13. ln -sf zerotier-one zerotier-cli
  14. ln -sf zerotier-one zerotier-idtool
  15. cd /usr/bin
  16. rm -f zerotier-cli zerotier-idtool
  17. ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" zerotier-cli
  18. ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" zerotier-idtool
  19. launchctl load /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1
  20. exit 0