preinst.sh 525 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  3. if [ -f /Library/LaunchDaemons/com.zerotier.one.plist ]; then
  4. launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1
  5. fi
  6. sleep 1
  7. if [ -d "/Library/Application Support/ZeroTier/One" ]; then
  8. cd "/Library/Application Support/ZeroTier/One"
  9. if [ -f "zerotier-one.pid" ]; then
  10. ztpid=`cat zerotier-one.pid`
  11. if [ "$ztpid" -gt "0" ]; then
  12. kill `cat zerotier-one.pid`
  13. fi
  14. fi
  15. fi
  16. sleep 1
  17. cd "/Applications"
  18. rm -rf "ZeroTier One.app"
  19. exit 0