diff options
author | BlackNoxis <steven.darklight@gmail.com> | 2014-02-15 23:24:26 +0200 |
---|---|---|
committer | BlackNoxis <steven.darklight@gmail.com> | 2014-02-15 23:24:26 +0200 |
commit | 7224c1253228e5c29c78cb3f0f26ce34770f2356 (patch) | |
tree | 1684924656132935256e034f35f92abee6623265 /app-misc/rogentoslive-tools/files/2/cdeject.sh |
Added ebuilds for kogaion desktop
Diffstat (limited to 'app-misc/rogentoslive-tools/files/2/cdeject.sh')
-rw-r--r-- | app-misc/rogentoslive-tools/files/2/cdeject.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app-misc/rogentoslive-tools/files/2/cdeject.sh b/app-misc/rogentoslive-tools/files/2/cdeject.sh new file mode 100644 index 00000000..ae75ae84 --- /dev/null +++ b/app-misc/rogentoslive-tools/files/2/cdeject.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +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 + |