Skip to content

Instantly share code, notes, and snippets.

@remi
Forked from jmlacroix/iPatch.sh
Created April 14, 2010 17:34
Show Gist options
  • Save remi/366091 to your computer and use it in GitHub Desktop.
Save remi/366091 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
@remi
Copy link
Author

remi commented Apr 14, 2010

I modified it to also check if VLC is running.

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