uninstall.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/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. echo "Killing any running zerotier-one service..."
  12. killall -q -TERM zerotier-one
  13. sleep 2
  14. killall -q -KILL zerotier-one
  15. echo "Removing SysV init items..."
  16. rm -fv /etc/init.d/zerotier-one
  17. find /etc/rc*.d -name '???zerotier-one' -print0 | xargs -0 rm -fv
  18. echo "Erasing binary and support files..."
  19. cd /var/lib/zerotier-one
  20. rm -rfv zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.sh updates.d networks.d iddb.d
  21. echo "Erasing anything installed into system bin directories..."
  22. rm -fv /usr/local/bin/zerotier-* /usr/bin/zerotier-*
  23. echo "Done."
  24. echo
  25. echo "Your ZeroTier One identity is still preserved in /var/lib/zerotier-one"
  26. echo "as identity.secret and can be manually deleted if you wish. Save it if"
  27. echo "you wish to re-use the address of this node, as it cannot be regenerated."
  28. echo
  29. exit 0