diff options
author | Bill Nottingham <notting@redhat.com> | 2009-03-24 16:42:37 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2009-03-24 16:42:37 -0400 |
commit | 7fed044885fb2eeb92fe59cec649318caff7e382 (patch) | |
tree | 1c453c3557829ab99b52dddcfdde3714385aaf6f | |
parent | 5c8995665e71133cd840dc8f5b1b48a9333e9706 (diff) | |
download | initscripts-7fed044885fb2eeb92fe59cec649318caff7e382.tar initscripts-7fed044885fb2eeb92fe59cec649318caff7e382.tar.gz initscripts-7fed044885fb2eeb92fe59cec649318caff7e382.tar.bz2 initscripts-7fed044885fb2eeb92fe59cec649318caff7e382.tar.xz initscripts-7fed044885fb2eeb92fe59cec649318caff7e382.zip |
Do a generic fallback based on provides of 'service(graphical-login)' (#485751, essentially.)
This removes hardcoded fallbacks.
-rwxr-xr-x | prefdm | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -35,10 +35,14 @@ shopt -s execfail [ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1 </dev/null -# Fallbacks, in order -exec gdm "$@" >/dev/null 2>&1 </dev/null -exec kdm "$@" >/dev/null 2>&1 </dev/null -exec wdm "$@" >/dev/null 2>&1 </dev/null -exec xdm "$@" >/dev/null 2>&1 </dev/null +for pkg in $(rpm -q --qf "%{NAME}\n" --whatprovides "service(graphical-login)") ; do + dm=$(rpm -q --provides $pkg | awk '/^service\(graphical-login\)/ { print $3 ; exit }') + if [ -n "$dm" ]; then + exec $dm "$@" >/dev/null 2>&1 </dev/null + else + exec $pkg "$@" >/dev/null 2>&1 </dev/null + fi +done + # catch all exit error exit 1 |