ZeroTierOne/ext/installfiles/mac/uninstall.sh

45 lines
1.2 KiB
Bash
Raw Normal View History

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
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'
rm -rf '/Applications/ZeroTier.app'
rm -f '/usr/local/bin/zerotier-one' '/usr/local/bin/zerotier-idtool' '/usr/local/bin/zerotier-cli' '/Library/LaunchDaemons/com.zerotier.one.plist'
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