Checking if a device is mounted using a script
hi!
i would like to write a script which does the following actions: 1. In case the cdrom is mounted, unmount and eject it. 2. In case it isn't mount it. Now I have these simple questions: How do I check if a device is mounted? How do I eject a cd? Thanx! |
"How do I check if a device is mounted?"
Use the mount command without any parameters to give you a list of all mounted devices and search the output using grep: mount | grep (grep parameters) if test $? -eq 0; then "How do I eject a cd?" Use the eject command. ___________________________________ Be prepared. Create a LifeBoat CD. http://users.rcn.com/srstites/LifeBo...home.page.html Steve Stites |
big thanks.
|
All times are GMT -5. The time now is 02:38 AM. |