2013-11-06 20:04:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-11-13 14:07:59 +00:00
|
|
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
|
|
|
2013-12-14 00:15:42 +00:00
|
|
|
ztpath="/Library/Application Support/ZeroTier/One"
|
|
|
|
ztapp="/Applications/ZeroTier One.app"
|
|
|
|
|
2013-11-06 20:04:05 +00:00
|
|
|
if [ "$UID" -ne 0 ]; then
|
2013-11-13 14:07:59 +00:00
|
|
|
echo "Must be run as root; try: sudo $0"
|
2013-11-06 20:04:05 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-11-13 14:07:59 +00:00
|
|
|
echo
|
|
|
|
|
|
|
|
echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
|
|
|
|
echo "Waiting 5 seconds..."
|
|
|
|
sleep 5
|
|
|
|
|
2013-12-14 00:15:42 +00:00
|
|
|
echo "Unloading and removing LaunchDaemons item..."
|
|
|
|
launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist
|
|
|
|
rm -f /Library/LaunchDaemons/com.zerotier.one.plist
|
2013-11-06 20:04:05 +00:00
|
|
|
|
|
|
|
echo "Killing any running zerotier-one service..."
|
2013-11-13 14:07:59 +00:00
|
|
|
killall -TERM zerotier-one >>/dev/null 2>&1
|
|
|
|
sleep 3
|
|
|
|
killall -KILL zerotier-one >>/dev/null 2>&1
|
2013-12-14 00:15:42 +00:00
|
|
|
sleep 1
|
2013-11-13 14:07:59 +00:00
|
|
|
|
|
|
|
echo "Unloading kernel extension..."
|
|
|
|
kextunload "$ztpath/tap.kext"
|
2013-11-06 20:04:05 +00:00
|
|
|
|
2013-12-14 00:15:42 +00:00
|
|
|
echo "Erasing UI app, binary, and support files..."
|
2013-11-06 20:04:05 +00:00
|
|
|
cd $ztpath
|
2013-12-14 00:15:42 +00:00
|
|
|
rm -rfv "$ztapp" zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.kext *.sh
|
2013-11-13 14:07:59 +00:00
|
|
|
|
|
|
|
echo "Done."
|
|
|
|
echo
|
|
|
|
echo "Your ZeroTier One identity is still preserved in $ztpath"
|
|
|
|
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."
|
|
|
|
|
|
|
|
echo
|
2013-11-06 20:04:05 +00:00
|
|
|
|
2013-11-13 14:07:59 +00:00
|
|
|
exit 0
|