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-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
|
|
|
|
|
2015-05-26 21:36:04 +00:00
|
|
|
if [ ! -f '/Library/LaunchDaemons/com.zerotier.one.plist' ]; then
|
|
|
|
echo 'ZeroTier One does not seem to be installed.'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd /
|
|
|
|
|
|
|
|
echo 'Stopping any running ZeroTier One service...'
|
|
|
|
launchctl unload '/Library/LaunchDaemons/com.zerotier.one.plist' >>/dev/null 2>&1
|
|
|
|
sleep 1
|
2013-11-13 14:07:59 +00:00
|
|
|
killall -TERM zerotier-one >>/dev/null 2>&1
|
2013-12-14 00:15:42 +00:00
|
|
|
sleep 1
|
2015-05-26 21:36:04 +00:00
|
|
|
killall -KILL zerotier-one >>/dev/null 2>&1
|
2013-11-13 14:07:59 +00:00
|
|
|
|
2015-05-26 21:36:04 +00:00
|
|
|
echo "Removing ZeroTier One files..."
|
2014-01-10 06:58:31 +00:00
|
|
|
|
2015-05-26 21:36:04 +00:00
|
|
|
rm -rf '/Applications/ZeroTier One.app'
|
2021-09-02 01:55:54 +00:00
|
|
|
rm -rf '/Applications/ZeroTier.app'
|
2018-09-23 23:53:30 +00:00
|
|
|
rm -f '/usr/local/bin/zerotier-one' '/usr/local/bin/zerotier-idtool' '/usr/local/bin/zerotier-cli' '/Library/LaunchDaemons/com.zerotier.one.plist'
|
2017-04-21 20:55:44 +00:00
|
|
|
|
|
|
|
cd '/Library/Application Support/ZeroTier/One'
|
|
|
|
if [ "`pwd`" = '/Library/Application Support/ZeroTier/One' ]; then
|
|
|
|
rm -rf *.d *.sh *.log *.old *.kext *.conf *.pkg *.dmg *.pid *.port *.save *.bin planet zerotier-* devicemap
|
|
|
|
fi
|
2013-11-13 14:07:59 +00:00
|
|
|
|
2015-05-26 21:36:04 +00:00
|
|
|
echo 'Uninstall complete.'
|
2013-11-13 14:07:59 +00:00
|
|
|
echo
|
2015-05-26 21:36:04 +00:00
|
|
|
echo 'Your identity and secret authentication token have been preserved in:'
|
|
|
|
echo ' /Library/Application Support/ZeroTier/One'
|
|
|
|
echo
|
|
|
|
echo 'You can delete this folder and its contents if you do not intend to re-use'
|
|
|
|
echo 'them.'
|
2013-11-13 14:07:59 +00:00
|
|
|
echo
|
2013-11-06 20:04:05 +00:00
|
|
|
|
2013-11-13 14:07:59 +00:00
|
|
|
exit 0
|