aboutsummaryrefslogtreecommitdiffstats
path: root/prefdm
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2004-09-23 20:29:31 +0000
committerBill Nottingham <notting@redhat.com>2004-09-23 20:29:31 +0000
commitb1c008f4a417fd7bd04874ed74e023b897dee021 (patch)
treeffd0d4b2bedc9055b21549f01721bb397d89cd91 /prefdm
parent51309064c371fc3e1fc33b1b611e9b4d87c70c0e (diff)
downloadinitscripts-b1c008f4a417fd7bd04874ed74e023b897dee021.tar
initscripts-b1c008f4a417fd7bd04874ed74e023b897dee021.tar.gz
initscripts-b1c008f4a417fd7bd04874ed74e023b897dee021.tar.bz2
initscripts-b1c008f4a417fd7bd04874ed74e023b897dee021.tar.xz
initscripts-b1c008f4a417fd7bd04874ed74e023b897dee021.zip
clean up prefdm
- don't use which... just try to exec the thing - remove completely useless stanza
Diffstat (limited to 'prefdm')
-rwxr-xr-xprefdm25
1 files changed, 5 insertions, 20 deletions
diff --git a/prefdm b/prefdm
index 3d21026d..ad8254e9 100755
--- a/prefdm
+++ b/prefdm
@@ -24,27 +24,12 @@ if [ -f /etc/sysconfig/desktop ]; then
fi
fi
-if [ -z "$preferred" ]; then
- if which gdm >/dev/null 2>&1; then
- preferred=gdm
- elif which kdm >/dev/null 2>&1; then
- preferred=kdm
- elif which xdm >/dev/null 2>&1; then
- preferred=xdm
- fi
-fi
+[ -n "$preferred" ] && exec $preferred $* >/dev/null 2>&1
-if [ -n "$preferred" ] && which $preferred >/dev/null 2>&1; then
- exec `which $preferred` $* >/dev/null 2>&1
-fi
-
-if which gdm >/dev/null 2>&1; then
- exec `which gdm` $* >/dev/null 2>&1
-elif which kdm >/dev/null 2>&1; then
- exec `which kdm` $* >/dev/null 2>&1
-elif which xdm >/dev/null 2>&1; then
- exec `which xdm` $* >/dev/null 2>&1
-fi
+# Fallbacks, in order
+exec gdm $* >/dev/null 2>&1
+exec kdm $* >/dev/null 2>&1
+exec xdm $* >/dev/null 2>&1
# catch all exit error
exit 1