Skip to content

Instantly share code, notes, and snippets.

@everzet
Forked from jmlacroix/iPatch.sh
Created May 7, 2010 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everzet/394020 to your computer and use it in GitHub Desktop.
Save everzet/394020 to your computer and use it in GitHub Desktop.
#!/bin/bash
IPATH="/Applications/iTunes.app/Contents/MacOS"
if [ ! -e "$IPATH/iTunesX" ]
then
sudo mv "$IPATH/iTunes" "$IPATH/iTunesX"
# has sudo failed?
if (( $? ))
then
exit
fi
sudo cat > "$IPATH/iTunes" <<-'EOF'
#!/bin/bash
PROCESS=$(ps aux | egrep "VLC|Ecoute" | egrep -v "egrep|Ecoute Helper")
if [ -z "$PROCESS" ]
then
"/Applications/iTunes.app/Contents/MacOS/iTunesX" &
disown %1
fi
EOF
sudo chmod uog+x "$IPATH/iTunes"
else
echo "Already patched."
fi
@everzet
Copy link
Author

everzet commented May 7, 2010

Will prevent iTunes from run when Ecoute or VLC running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment