diff options
Diffstat (limited to 'abs/core-testing/linhes-live/etc')
-rw-r--r-- | abs/core-testing/linhes-live/etc/live-shutdown | 46 | ||||
-rwxr-xr-x | abs/core-testing/linhes-live/etc/rc.shutdown-live | 2 |
2 files changed, 40 insertions, 8 deletions
diff --git a/abs/core-testing/linhes-live/etc/live-shutdown b/abs/core-testing/linhes-live/etc/live-shutdown index 459d4f2..6e12d22 100644 --- a/abs/core-testing/linhes-live/etc/live-shutdown +++ b/abs/core-testing/linhes-live/etc/live-shutdown @@ -37,17 +37,49 @@ f_swapoff () f_remountro () { - if [ -n "${ejectdev}" ]; then - echo "Ejecting live CD" - eject ${ejectdev} - echo "========================================" - echo "It's safe to switch the computer off now" - echo -ne "Press Enter to continue" - read junk + bootdev=`cat /.livesys/bootdevice` + bootdev=`basename $bootdev` + for i in `ls -H /dev/cd/*` + do + cdrom=`basename $i|cut -d- -f2` + if [ x$cdrom = x$bootdev ] + then + ejectdev=$cdrom + fi + break + done + lspci |grep -q VMware + if [ ! $? = 0 ] + then + if [ -n "${ejectdev}" ] + then + echo "Ejecting CD" + eject ${ejectdev} + echo "========================================" + echo "Tray will retract after 10 seconds" + for timer in `seq -w 10 -1 0` + do + #echo -n $timer '\x08' + echo -ne "\t"$timer '\010\010\010\010' + sleep 1 + done + echo + echo "========================================" + eject -t ${ejectdev} + echo + echo "It's safe to switch the computer off now" + #echo -ne "Press Enter to continue" + #read junk + else + echo "Boot device is not a cdrom, no need to eject" + fi + else + echo "VMWARE detected, not ejecting the CD" fi } #Preloads these commands so we can eject the CD. # +seq --help >/dev/null 2>&1 eject --help >/dev/null 2>&1 halt --help >/dev/null 2>&1 poweroff --help >/dev/null 2>&1 diff --git a/abs/core-testing/linhes-live/etc/rc.shutdown-live b/abs/core-testing/linhes-live/etc/rc.shutdown-live index 896bae2..79eae47 100755 --- a/abs/core-testing/linhes-live/etc/rc.shutdown-live +++ b/abs/core-testing/linhes-live/etc/rc.shutdown-live @@ -150,7 +150,7 @@ fi #F Remount / ro f_remountro #Eject the CD -eject + # Power off or reboot if [ "$RUNLEVEL" = "0" ]; then printsep |