summaryrefslogtreecommitdiff
path: root/app-misc/rogentoslive-tools/files/1.0/cdeject
diff options
context:
space:
mode:
authorBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:24:26 +0200
committerBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:24:26 +0200
commit7224c1253228e5c29c78cb3f0f26ce34770f2356 (patch)
tree1684924656132935256e034f35f92abee6623265 /app-misc/rogentoslive-tools/files/1.0/cdeject
Added ebuilds for kogaion desktop
Diffstat (limited to 'app-misc/rogentoslive-tools/files/1.0/cdeject')
-rw-r--r--app-misc/rogentoslive-tools/files/1.0/cdeject23
1 files changed, 23 insertions, 0 deletions
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 <lxnay@sabayon.org>
+# 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
+}