|
|
|
Filter by bus type (FireWire, ATAPI)
The change is fairly simple. Instead of relying on vendors, it would be better to filter by the bus type (the internal ATA, or external FireWire or USB):
#!/bin/sh
##==================================================
# opensesame -- open/close external optical drives
##==================================================
if [ -z $(uname -r | grep "7.") ]; then
echo "Sorry, $(basename $0) require OS X 10.3+"
exit 1
fi
if [ -z "$1" ]; then
echo "usage: $(basename $0) -c (closes external optical drive)"
echo " $(basename $0) -o (opens external optical drive)"
exit 1
fi
theDRIVE=$(/usr/bin/drutil list | awk '/(FireWire)|(USB)/ {print $1}')
if [ "$1" = "-c" ]; then
drutil tray close -drive $theDRIVE
elif [ "$1" = "-o" ]; then
drutil eject -drive $theDRIVE
fi
|
SearchFrom our Sponsor...Latest Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2013 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.06 seconds |
|