-
-
Save remi/366091 to your computer and use it in GitHub Desktop.
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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I modified it to also check if VLC is running.