Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-23-2008, 02:07 AM   #1
LQ Newbie
Registered: May 2008
Posts: 10

Rep: Reputation: 0
Lightbulb bash script for detecting USB CD-ROM


Can anybody help to write bash script for detecting USB CD-ROM?

Thanks & Regards
Old 05-23-2008, 04:12 AM   #2
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

You could use either 'lsusb' or 'lshal' to find out what's plugged in. lsusb is probably easier.

Just run '/sbin/lsusb' with and without the drive plugged in and see what the drive comes up as. Grep for the description part of the line, and you'll be able to tell whether it's plugged in from a script.

If you need any more, post the lsusb output with and without the drive plugged in, and we'll see what we can see.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting & detecting DVD ROM g4j31a5 Programming 4 07-19-2007 11:21 PM
bash script help - detecting if media is present dv502 Programming 4 05-17-2007 07:12 AM
Installation Problems Detecting My CD/DVD Rom CaptainCarisma Linux - Hardware 1 10-03-2006 02:09 AM
BASH script for resetting USB ylikone Programming 1 05-31-2006 06:28 PM
Bash Script to Detect USB drive mount status nutthick Programming 6 02-02-2005 08:17 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration