diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 20:32:39 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 20:32:39 -0600 |
commit | fa8e4262f55433b54a2e97922b86ce922ccef1d8 (patch) | |
tree | 21a1136c71f45cc70709dc9bb262d2c61523fb65 | |
parent | febcc86370a1ae7eb1c1c42df9731b02d72b7964 (diff) | |
download | tdebase-fa8e4262f55433b54a2e97922b86ce922ccef1d8.tar.gz tdebase-fa8e4262f55433b54a2e97922b86ce922ccef1d8.zip |
Fix nominal kdeeject problems.
This resolves bug report 1197.
-rwxr-xr-x | kdeeject/kdeeject | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/kdeeject/kdeeject b/kdeeject/kdeeject index 34e61097e..b97ab5df6 100755 --- a/kdeeject/kdeeject +++ b/kdeeject/kdeeject @@ -11,20 +11,20 @@ if test "$1" = "-q"; then fi if test "$1" = "--help"; then - echo "Usage: $0 <name> where name is a device or a mountpoint." - exit 0 + echo "Usage: $0 <name> where name is a device or a mountpoint." + exit 0 fi if test -z "$1"; then for dev in /dev/cdrom /dev/dvd /dev/dvdram /dev/cdrecorder; do - if test -e $dev; then - lp=`readlink $dev` - if test -n "$lp"; then - device=/dev/$lp - else - device=$dev - fi - break + if test -e $dev; then + lp=`readlink $dev` + if test -n "$lp"; then + device=/dev/$lp + else + device=$dev + fi + break fi done else @@ -33,32 +33,31 @@ fi udi=`dcop kded mediamanager properties $device 2>/dev/null | head -n 1 ` if test -n "$udi"; then - dcop kded mediamanager unmount "$udi" >/dev/null 2>&1 + dcop kded mediamanager unmount "$udi" >/dev/null 2>&1 fi - # Checking for stuff in the PATH is ugly with sh. - # I guess this is the reason for making this a kde app... - OS=`uname -s` - case "$OS" in - OpenBSD) - cdio -f $1 eject >/dev/null 2>&1 - ;; - *BSD) - dev=`echo $1 | sed -E -e 's#/dev/##' -e 's/([0-9])./\1/'` - cdcontrol -f $dev eject >/dev/null 2>&1 - ;; - *) - # Warning, it has to be either eject 2.0.x or >=2.1.5 - # Otherwise it doesn't work as expected (it requires a - # fstab entry for no reason). - eject $1 >/dev/null 2>&1 - ;; - esac - if test $? -eq 0; then -# dcop kdesktop default refreshIcons - exit 0 - elif test $quiet -eq 0; then - kdialog --title "KDE Eject" --error "Eject $1 failed!" - fi - +# Checking for stuff in the PATH is ugly with sh. +# I guess this is the reason for making this a kde app... +OS=`uname -s` +case "$OS" in + OpenBSD) + cdio -f $device eject #>/dev/null 2>&1 + ;; + *BSD) + dev=`echo $device | sed -E -e 's#/dev/##' -e 's/([0-9])./\1/'` + cdcontrol -f $dev eject #>/dev/null 2>&1 + ;; + *) + # Warning, it has to be either eject 2.0.x or >=2.1.5 + # Otherwise it doesn't work as expected (it requires a + # fstab entry for no reason). + eject -v $device #>/dev/null 2>&1 + ;; +esac +if test $? -eq 0; then + #dcop kdesktop default refreshIcons + exit 0 +elif test $quiet -eq 0; then + kdialog --title "KDE Eject" --error "Eject $device failed!" +fi exit 1 |