uninstall.sh 902 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. echo
  8. echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
  9. echo "Waiting 5 seconds..."
  10. sleep 5
  11. ztpath="/Library/Application Support/ZeroTier/One"
  12. echo "Killing any running zerotier-one service..."
  13. killall -TERM zerotier-one >>/dev/null 2>&1
  14. sleep 3
  15. killall -KILL zerotier-one >>/dev/null 2>&1
  16. echo "Unloading kernel extension..."
  17. kextunload "$ztpath/tap.kext"
  18. echo "Erasing binary and support files..."
  19. cd $ztpath
  20. rm -rfv zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.kext
  21. echo "Done."
  22. echo
  23. echo "Your ZeroTier One identity is still preserved in $ztpath"
  24. echo "as identity.secret and can be manually deleted if you wish. Save it if"
  25. echo "you wish to re-use the address of this node, as it cannot be regenerated."
  26. echo
  27. exit 0