From 7224c1253228e5c29c78cb3f0f26ce34770f2356 Mon Sep 17 00:00:00 2001 From: BlackNoxis Date: Sat, 15 Feb 2014 23:24:26 +0200 Subject: Added ebuilds for kogaion desktop --- app-misc/rogentoslive-tools/files/1.0/cdeject | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app-misc/rogentoslive-tools/files/1.0/cdeject (limited to 'app-misc/rogentoslive-tools/files/1.0/cdeject') diff --git a/app-misc/rogentoslive-tools/files/1.0/cdeject b/app-misc/rogentoslive-tools/files/1.0/cdeject new file mode 100644 index 00000000..6d56f043 --- /dev/null +++ b/app-misc/rogentoslive-tools/files/1.0/cdeject @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright (c) 2010 Fabio Erculiani +# All rights reserved. Released under the 2-clause BSD license. + +description="Eject LiveCD/DVD at live system shutdown/reboot" + +depend() +{ + after * +} + +start() +{ + is_live=$(cat /proc/cmdline | grep cdroot) + if [ -n "${is_live}" ]; then + cdrom_dev=$(cat /proc/mounts | grep " /mnt/cdrom " | cut -d" " -f 1) + # check if /mnt/cdrom device is a cdrom device + if [ "${cdrom_dev}" = /dev/sr* ] || [ "${cdrom_dev}" = /dev/cdrom* ]; then + eject -mp "${cdrom_dev}" &> /dev/null + fi + fi + eend 0 +} -- cgit v1.2.3