uninstall.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  3. if [ "$UID" -ne 0 ]; then
  4. echo "Must be run as root; try: sudo $0"
  5. exit 1
  6. fi
  7. if [ ! -f '/Library/LaunchDaemons/com.zerotier.one.plist' ]; then
  8. echo 'ZeroTier One does not seem to be installed.'
  9. exit 1
  10. fi
  11. cd /
  12. echo 'Stopping any running ZeroTier One service...'
  13. launchctl unload '/Library/LaunchDaemons/com.zerotier.one.plist' >>/dev/null 2>&1
  14. sleep 1
  15. killall -TERM zerotier-one >>/dev/null 2>&1
  16. sleep 1
  17. killall -KILL zerotier-one >>/dev/null 2>&1
  18. echo "Removing ZeroTier One files..."
  19. rm -rf '/Applications/ZeroTier One.app'
  20. rm -rf '/Applications/ZeroTier.app'
  21. rm -f '/usr/local/bin/zerotier-one' '/usr/local/bin/zerotier-idtool' '/usr/local/bin/zerotier-cli' '/Library/LaunchDaemons/com.zerotier.one.plist'
  22. cd '/Library/Application Support/ZeroTier/One'
  23. if [ "`pwd`" = '/Library/Application Support/ZeroTier/One' ]; then
  24. rm -rf *.d *.sh *.log *.old *.kext *.conf *.pkg *.dmg *.pid *.port *.save *.bin planet zerotier-* devicemap
  25. fi
  26. echo 'Uninstall complete.'
  27. echo
  28. echo 'Your identity and secret authentication token have been preserved in:'
  29. echo ' /Library/Application Support/ZeroTier/One'
  30. echo
  31. echo 'You can delete this folder and its contents if you do not intend to re-use'
  32. echo 'them.'
  33. echo
  34. exit 0