:shock: :shock:
its me again!
I am using the docache option and want to test if a CD is inside of the CD-drive, or I want to wait, until a cd is insert.
Now I googeld and found some ways checking this, but with help from a Programm or with checking a Path where the CD will be automountet...
SO anyone know, how can i check, if the cd is ejected or not?
I searched on CDRecord, but diddn't found a option...
27 Feb 2008, 11:15
admin
Site Admin
Joined: 17 Jul 2003, 09:44 Posts: 2693
I think you can try to read a block from the device to know whether or not there is a cdrom.
I assume the cdrom device is /dev/sr0:
Code:
if dd if=/dev/sr0 of=/dev/null count=1 2>/dev/null then echo "there is a disc" else echo "there is no disc" fi
27 Feb 2008, 14:35
LinuxNewby
Joined: 21 Jan 2008, 15:18 Posts: 12
yes it works, it checks if a cd ist insert thx, but i don't know if its ejectet or emty but this will work for the start.. thx..
28 Feb 2008, 09:07
LinuxNewby
Joined: 21 Jan 2008, 15:18 Posts: 12
the Problem is,
Code:
if dd if=/dev/sr0 of=/dev/null count=1 2>/dev/null
is true 1. if there is no disc and 2. if there is a empty disc inside...
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum