Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Filter by bus type (FireWire, ATAPI)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Filter by bus type (FireWire, ATAPI)
Authored by: gatorparrots on Feb 15, '05 01:32:51PM
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):
# opensesame -- open/close external optical drives
if [ -z $(uname -r | grep "7.") ]; then
    echo "Sorry, $(basename $0) require OS X 10.3+"
    exit 1
if [ -z "$1" ]; then
    echo "usage: $(basename $0) -c (closes external optical drive)"
    echo "       $(basename $0) -o (opens external optical drive)"
    exit 1
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

[ Reply to This | # ]