mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kdeeject: modernize
This commit is contained in:
parent
3a4377f1ca
commit
803f26c175
1 changed files with 6 additions and 6 deletions
|
@ -12,23 +12,23 @@ if test $# -ge 1 -a "$1" != "--help"; then
|
|||
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`
|
||||
OS=$(uname -s)
|
||||
case "$OS" in
|
||||
OpenBSD)
|
||||
cdio -f $1 eject >/dev/null 2>&1
|
||||
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
|
||||
dev=$(echo "$1" | sed -E -e 's#/dev/##' -e 's/([0-9])./\1/')
|
||||
cdcontrol -f "$dev" eject >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
eject $1 >/dev/null 2>&1
|
||||
eject "$1" >/dev/null 2>&1
|
||||
;;
|
||||
esac
|
||||
if test $? -eq 0; then
|
||||
qdbus org.kde.kdesktop /Desktop refreshIcons
|
||||
exit 0
|
||||
elif test $quiet -eq 0; then
|
||||
elif test "$quiet" -eq 0; then
|
||||
kdialog --title "KDE Eject" --error "Eject $1 failed!"
|
||||
fi
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue