#!/bin/sh TMPFILE="/var/cdd/cdd.tmp" CDD=`cat $TMPFILE` if [ $CDD == "closed" ]; then ( umount /mnt/cdrom >/dev/null 2>/dev/null ; eject >/dev/null 2>/dev/null ) & echo opened > $TMPFILE else ( eject -t >/dev/null 2>/dev/null ; mount /mnt/cdrom >/dev/null 2>/dev/null ) & echo closed > $TMPFILE fi