uninstall.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 -fv zerotier-one *.persist authtoken.secret identity.public *.log *.pid
  21. rm -rfv updates.d networks.d iddb.d
  22. echo "Erasing anything installed into system bin directories..."
  23. rm -fv /usr/local/bin/zerotier-* /usr/bin/zerotier-*
  24. echo "Done."
  25. echo
  26. echo "Your ZeroTier One identity is still preserved in /var/lib/zerotier-one"
  27. echo "as identity.secret and can be manually deleted if you wish. Save it if"
  28. echo "you wish to re-use the address of this node, as it cannot be regenerated."
  29. echo
  30. exit 0