uninstall.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  3. ztpath="/Library/Application Support/ZeroTier/One"
  4. ztapp="/Applications/ZeroTier One.app"
  5. if [ "$UID" -ne 0 ]; then
  6. echo "Must be run as root; try: sudo $0"
  7. exit 1
  8. fi
  9. echo
  10. echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
  11. echo "Waiting 5 seconds..."
  12. sleep 5
  13. echo "Unloading and removing LaunchDaemons item..."
  14. launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist
  15. rm -f /Library/LaunchDaemons/com.zerotier.one.plist
  16. echo "Killing any running zerotier-one service..."
  17. killall -TERM zerotier-one >>/dev/null 2>&1
  18. sleep 3
  19. killall -KILL zerotier-one >>/dev/null 2>&1
  20. sleep 1
  21. echo "Unloading kernel extension..."
  22. kextunload "$ztpath/tap.kext"
  23. echo "Erasing UI app, binary, and support files..."
  24. cd $ztpath
  25. rm -rfv "$ztapp" zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.kext *.sh
  26. echo "Done."
  27. echo
  28. echo "Your ZeroTier One identity is still preserved in $ztpath"
  29. echo "as identity.secret and can be manually deleted if you wish. Save it if"
  30. echo "you wish to re-use the address of this node, as it cannot be regenerated."
  31. echo
  32. exit 0