Annotation of /trunk/magellan-initscripts/etc/rc.d/init.d/xdm
Parent Directory | Revision Log
Revision 13 -
(hide annotations)
(download)
Mon Dec 13 23:46:52 2004 UTC (19 years, 4 months ago) by niro
File size: 1513 byte(s)
Mon Dec 13 23:46:52 2004 UTC (19 years, 4 months ago) by niro
File size: 1513 byte(s)
removed cruft.
1 | niro | 2 | #!/bin/bash |
2 | |||
3 | #%rlevels: 5:s 0:k 1:k 2:k 3:k 4:k 6:k | ||
4 | #%start: 95 | ||
5 | #%stop: 05 | ||
6 | |||
7 | #deps | ||
8 | #%needs: | ||
9 | #%before: | ||
10 | #%after: | ||
11 | |||
12 | source /etc/sysconfig/rc | ||
13 | source $rc_functions | ||
14 | source /etc/rc.config | ||
15 | source /etc/profile | ||
16 | |||
17 | if [ -z ${GLOGIN} ] | ||
18 | then | ||
19 | echo "You have to declare \"GLOGIN\" in /etc/rc.conf !" | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | get_login() { | ||
24 | case "$GLOGIN" in | ||
25 | kdm|KDM) | ||
26 | GLOGINCMD="$(which kdm 2> /dev/null)" | ||
27 | if [ ! -f "${GLOGINCMD}" ] | ||
28 | then | ||
29 | echo "Failure: KDE Login Manager not found." | ||
30 | exit 1 | ||
31 | fi | ||
32 | ;; | ||
33 | xdm|XDM) | ||
34 | GLOGINCMD="$(which xdm 2> /dev/null)" | ||
35 | if [ ! -f "${GLOGINCMD}" ] | ||
36 | then | ||
37 | echo "Failure: XDM Login Manager not found." | ||
38 | exit 1 | ||
39 | fi | ||
40 | ;; | ||
41 | *) | ||
42 | GLOGINCMD="$(which ${GLOGIN} 2> /dev/null)" | ||
43 | if [ ! -f "${GLOGINCMD}" ] | ||
44 | then | ||
45 | echo "Failure: \"${GLOGIN}\" Login Manager not found." | ||
46 | exit 1 | ||
47 | fi | ||
48 | esac | ||
49 | } | ||
50 | |||
51 | case "$1" in | ||
52 | niro | 13 | start) |
53 | niro | 2 | get_login |
54 | niro | 13 | echo -e ${COLOREDSTAR}"Starting ${GLOGIN} ..." |
55 | niro | 2 | /sbin/telinit a |
56 | evaluate_retval | ||
57 | |||
58 | update_svcstatus $1 | ||
59 | splash svc_started "$(basename $0)" 0 | ||
60 | ;; | ||
61 | niro | 13 | stop) |
62 | niro | 2 | get_login |
63 | if [ -n "$(ps -A|grep $(basename ${GLOGINCMD}))" ] | ||
64 | then | ||
65 | niro | 13 | echo -e ${COLOREDSTAR}"Stopping ${GLOGIN} ..." |
66 | niro | 2 | |
67 | CUR_VT=$(fgconsole) | ||
68 | start-stop-daemon --stop --quiet --exe ${GLOGINCMD} | ||
69 | evaluate_retval | ||
70 | chvt ${CUR_VT} | ||
71 | fi | ||
72 | update_svcstatus $1 | ||
73 | splash svc_started "$(basename $0)" 0 | ||
74 | ;; | ||
75 | |||
76 | niro | 13 | restart) |
77 | $0 stop | ||
78 | sleep 1 | ||
79 | $0 start | ||
80 | ;; | ||
81 | status) | ||
82 | niro | 2 | get_login |
83 | niro | 13 | statusproc ${GLOGINCMD} |
84 | ;; | ||
85 | *) | ||
86 | echo "Usage: $0 {start|stop|restart|status}" | ||
87 | exit 1 | ||
88 | ;; | ||
89 | niro | 2 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |