launch.sh 636 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. zthome="/Library/Application Support/ZeroTier/One"
  3. ztapp="/Applications/ZeroTier One.app"
  4. export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$zthome"
  5. # Uninstall if the .app has been thrown away
  6. if [ ! -d "$ztapp" ]; then
  7. if [ -e "$zthome/uninstall.sh" ]; then
  8. cd "$zthome"
  9. ./uninstall.sh -q
  10. exit
  11. fi
  12. fi
  13. # Create the app deletion notification symlink if it does
  14. # not already exist.
  15. if [ ! -L "$zthome/shutdownIfUnreadable" ]; then
  16. rm -f "$zthome/shutdownIfUnreadable"
  17. ln -sf "$ztapp/Contents/Info.plist" "$zthome/shutdownIfUnreadable"
  18. fi
  19. # Launch ZeroTier One (not as daemon... launchd monitors it)
  20. exec zerotier-one