Magellan Linux

Annotation of /trunk/xorg/xdm.rc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (hide annotations) (download)
Sun Feb 19 15:04:15 2006 UTC (18 years, 2 months ago) by niro
File size: 2253 byte(s)
added more login-managers

1 niro 28 #!/bin/bash
2 niro 62 # $Header: /root/magellan-cvs/src/xorg/xdm.rc,v 1.2 2006-02-19 15:04:15 niro Exp $
3 niro 28
4     #%rlevels: 5:s 0:k 1:k 2:k 3:k 4:k 6:k
5     #%start: 95
6     #%stop: 05
7    
8     #deps
9     #%needs:
10     #%before:
11     #%after:
12    
13     source /etc/sysconfig/rc
14     source $rc_functions
15     source /etc/rc.config
16     source /etc/profile
17    
18     if [ -z ${GLOGIN} ]
19     then
20     echo "You have to declare \"GLOGIN\" in /etc/rc.conf !"
21     exit 1
22     fi
23    
24     XDM_OPT=$1
25    
26     get_login() {
27     case "$GLOGIN" in
28     kdm|KDM)
29     GLOGINCMD="$(which kdm 2> /dev/null)"
30     if [ ! -f "${GLOGINCMD}" ]
31     then
32     echo "Failure: KDE Login Manager not found."
33     exit 1
34     fi
35     ;;
36 niro 62
37 niro 28 gdm|GDM)
38     if [[ ${XDM_OPT} = stop ]]
39     then
40     GLOGINCMD="$(which gdm-binary 2> /dev/null)"
41     else
42     GLOGINCMD="$(which gdm 2> /dev/null)"
43     fi
44     if [ ! -f "${GLOGINCMD}" ]
45     then
46 niro 62 echo "Failure: GNOME Login Manager not found."
47 niro 28 exit 1
48     fi
49     ;;
50 niro 62
51     entrance*|ENTRANCE*)
52     GLOGINCMD="$(which entranced 2> /dev/null)"
53     if [ ! -f "${GLOGINCMD}" ]
54     then
55     echo "Failure: Enlightenment Login Manager not found."
56     exit 1
57     fi
58     ;;
59    
60     wdm|WDM)
61     GLOGINCMD="$(which wdm 2> /dev/null)"
62     if [ ! -f "${GLOGINCMD}" ]
63     then
64     echo "Failure: Windowmaker Login Manager not found."
65     exit 1
66     fi
67     ;;
68    
69 niro 28 xdm|XDM)
70     GLOGINCMD="$(which xdm 2> /dev/null)"
71     if [ ! -f "${GLOGINCMD}" ]
72     then
73     echo "Failure: XDM Login Manager not found."
74     exit 1
75     fi
76     ;;
77 niro 62
78 niro 28 *)
79     GLOGINCMD="$(which ${GLOGIN} 2> /dev/null)"
80     if [ ! -f "${GLOGINCMD}" ]
81     then
82     echo "Failure: \"${GLOGIN}\" Login Manager not found."
83     exit 1
84     fi
85 niro 62 ;;
86 niro 28 esac
87     }
88    
89     case "${XDM_OPT}" in
90     start)
91     get_login
92     echo -e ${COLOREDSTAR}"Starting ${GLOGIN} ..."
93     /sbin/telinit a
94     evaluate_retval
95    
96     update_svcstatus $1
97     splash svc_started "$(basename $0)" 0
98     ;;
99     stop)
100     get_login
101     if [ -n "$(ps -A|grep $(basename ${GLOGINCMD}))" ]
102     then
103     echo -e ${COLOREDSTAR}"Stopping ${GLOGIN} ..."
104    
105     CUR_VT=$(fgconsole)
106     start-stop-daemon --stop --quiet --exe ${GLOGINCMD}
107     evaluate_retval
108     chvt ${CUR_VT}
109     fi
110     update_svcstatus $1
111     splash svc_stopped "$(basename $0)" 0
112     ;;
113    
114     restart)
115     $0 stop
116     sleep 1
117     $0 start
118     ;;
119     status)
120     get_login
121     statusproc ${GLOGINCMD}
122     ;;
123     *)
124     echo "Usage: $0 {start|stop|restart|status}"
125     exit 1
126     ;;
127     esac

Properties

Name Value
svn:executable *