ZeroTierOne/ext/installfiles/linux/uninstall.sh

41 lines
1.1 KiB
Bash
Raw Normal View History

2013-11-06 20:04:05 +00:00
#!/bin/bash
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
if [ "$UID" -ne 0 ]; then
2013-11-08 19:32:23 +00:00
echo "Must be run as root; try: sudo $0"
2013-11-06 20:04:05 +00:00
exit 1
fi
2013-11-08 19:32:23 +00:00
echo
echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
2013-11-06 20:04:05 +00:00
echo "Waiting 5 seconds..."
sleep 5
echo "Killing any running zerotier-one service..."
2013-11-08 19:32:23 +00:00
killall -q -TERM zerotier-one
sleep 2
2013-11-06 20:04:05 +00:00
killall -q -KILL zerotier-one
echo "Removing SysV init items..."
rm -fv /etc/init.d/zerotier-one
find /etc/rc*.d -name '???zerotier-one' -print0 | xargs -0 rm -fv
2013-11-06 20:04:05 +00:00
echo "Erasing binary and support files..."
2013-11-08 19:32:23 +00:00
cd /var/lib/zerotier-one
rm -rfv zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.sh updates.d networks.d iddb.d
2013-11-06 20:04:05 +00:00
echo "Erasing anything installed into system bin directories..."
rm -fv /usr/local/bin/zerotier-* /usr/bin/zerotier-*
2013-11-08 19:32:23 +00:00
echo "Done."
echo
echo "Your ZeroTier One identity is still preserved in /var/lib/zerotier-one"
echo "as identity.secret and can be manually deleted if you wish. Save it if"
echo "you wish to re-use the address of this node, as it cannot be regenerated."
2013-11-06 20:04:05 +00:00
2013-11-08 19:32:23 +00:00
echo
2013-11-13 14:07:59 +00:00
exit 0