Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Instructions:
- # 1. Save this file to anti-macshop.sh (or another name.sh) by clicking download above or copy pasting this text into an empty file.
- # 2. Open up the Terminal
- # 3. Change directory to where the file is using 'cd directory' (for ex: cd ~/Desktop/)
- # 4. type 'chmod +x anti-macshop.sh' in the terminal
- # 5. type './anti-macshop.sh'
- # 6. Script will delete all references it can find to macshop in common directories. Tested and safe.
- delete_files () {
- echo "Searching $1 for $2"
- IFS=$'\n'
- found=($(find "$1" -iname "$2" -print))
- echo "Found ${#found[@]} matching files."
- for file in "${found[@]}"
- do
- echo "Deleting: $file"
- mv "$file" ~/.Trash
- done
- echo "Done."
- }
- # Spaces between equals break this
- APPS_DIR=/Applications/
- SAFARI_EXT_DIR=~/Library/Safari/Extensions/
- FIREFOX_EXT_DIR=~/Library/Application\ Support/Firefox/Profiles/
- CHROME_EXT_DIR=~/Library/Application\ Support/Google/Chrome/
- echo ""
- echo "Finding Applications directory..."
- if [ -d "$APPS_DIR" ]; then
- echo "Applications directory found."
- delete_files $APPS_DIR "*macshop*"
- else
- echo "Applications directory not found."
- fi
- echo ""
- echo "Finding Safari extensions directory..."
- if [ -d "$SAFARI_EXT_DIR" ]; then
- echo "Safari Extensions found."
- delete_files $SAFARI_EXT_DIR "*macshop*"
- else
- echo "Safari extensions directory not found."
- fi
- echo ""
- echo "Finding Firefox extensions directory..."
- if [ -d "$FIREFOX_EXT_DIR" ]; then
- echo "Firefox Extensions found."
- delete_files $FIREFOX_EXT_DIR "*macshop*"
- else
- echo "Firefox extensions directory not found."
- fi
- echo ""
- echo "Finding Chrome extensions directory..."
- if [ -d "$CHROME_EXT_DIR" ]; then
- echo "Chrome Extensions found."
- delete_files $CHROME_EXT_DIR "*macshop*"
- else
- echo "Chrome extensions directory not found."
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement