Last active
August 29, 2015 14:09
Remove Focus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ACTIVE_NETWORK=$(echo "open|||get Setup:/Network/Service/$(echo "open|||get State:/Network/Global/IPv4|||d.show" | tr '|||' '\n' | scutil | grep "PrimaryService" | awk '{print $3}') |||d.show" | tr '|||' '\n' | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}') | |
echo "Active network is '$ACTIVE_NETWORK'" | |
echo "Turning off active network PAC" | |
sudo networksetup -setautoproxystate "$ACTIVE_NETWORK" off | |
echo "Removing NSUserDefaults" | |
rm -rf ~/Library/Preferences/BradJasper.focus* | |
rm ~/Library/Containers/BradJasper.focus/Data/Library/Preferences/BradJasper.focus.plist | |
defaults delete BradJasper.focus | |
echo "Removing CoreData" | |
rm -rf ~/Library/Application\ Support/Focus/ | |
echo "Killing helper tool" | |
ps aux | grep BradJasper.focus.HelperTool | grep -v grep | awk '{print $2}' | xargs sudo kill -9 | |
sudo rm -rf /Library/PrivilegedHelperTools/BradJasper.focus.HelperTool | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment