#!/bin/bash source /etc/profile source /etc/rc.config get_login() { case "$GLOGIN" in kdm|KDM) GLOGINCMD="$(which kdm 2> /dev/null)" if [ ! -f "${GLOGINCMD}" ] then echo "Failure: KDE Login Manager not found." exit 1 fi ;; xdm|XDM) GLOGINCMD="$(which xdm 2> /dev/null)" if [ ! -f "${GLOGINCMD}" ] then echo "Failure: XDM Login Manager not found." exit 1 fi ;; *) GLOGINCMD="$(which ${GLOGIN} 2> /dev/null)" if [ ! -e "${GLOGINCMD}" ] then echo "Failure: \"${GLOGIN}\" Login Manager not found." exit 1 fi ;; esac } if [ -n "$GLOGIN" ] then get_login /sbin/start-stop-daemon --start --quiet --exec ${GLOGINCMD} retval="$?" sleep 5 if [ "${retval}" -ne 0 ] then echo "Couln't start your Displaymanager" killall -9 ${GLOGIN##*/} fi fi