ZeroTierOne/installer/linux/uninstall.sh

37 lines
955 B
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
2013-11-06 20:04:05 +00:00
echo "Going to uninstall zerotier-one, hit CTRL+C to abort."
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 "Erasing binary and support files..."
2013-11-08 19:32:23 +00:00
cd /var/lib/zerotier-one
rm -fv zerotier-one *.persist authtoken.secret identity.public *.log
rm -rfv updates.d networks.d iddb.d
2013-11-06 20:04:05 +00:00
echo "Removing init items..."
rm -fv /etc/init.d/zerotier-one
2013-11-08 19:32:23 +00:00
find /etc/rc*.d -name '???zerotier-one' -print0 | xargs -0 rm -fv
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