|
|
Overkill
Just as sudo is unnecessary to kill iTunes and change directory permissions, the "-9" argument to killall is really unnecessary. It doesn't give iTunes a chance to exit gracefully and do the normal cleanup that it does when it exits. Either a regular killall without "-9" would be better, or just tell the user to quit. Heck, you could even do it via AppleScript:
The current method is kind of like using a sledgehammer to ring a doorbell - it'll get the job done, but it's overkill and may cause unintended damage. The one way in which sudo would be useful here is if the script changed ownership of the directories to root. Then a future version of iTunes wouldn't be able to change permissions back. As it is now, if the directories don't exist, they will be owned by root (because they are created using sudo), but if they do already exist, ownership won't change. I'd just create directories as the user and then only use sudo to chown them to root. Finally, I'd prefer to move any existing updates out of the way rather than deleting them.
Overkill
Running oascript on Snow Leopard can give a strange error. To prevent this you can change:
osascript
to:
arch -i386 osascript
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.32 seconds |
|