man eject! See: -t option. What you want is a little script that looks for the state of your cdrom drive and does eject or eject -t on it. That should be doable :) Greets, Maxi