]>
Commit | Line | Data |
---|---|---|
8c3235ca AM |
1 | #!/bin/sh |
2 | # | |
3 | # dpcproxy This shell script takes care of starting and stopping dpcproxy. | |
4 | # | |
5 | # chkconfig: 2345 80 30 | |
c7c24363 ER |
6 | # description: dpcproxy is a Intel Server Management cli service |
7 | # | |
8c3235ca | 8 | # processname: dpcproxy |
8c3235ca AM |
9 | |
10 | # Source function library. | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Source networking configuration. | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Source oident configureation. | |
17 | if [ -f /etc/sysconfig/dpcproxy ]; then | |
18 | . /etc/sysconfig/dpcproxy | |
8c3235ca AM |
19 | fi |
20 | ||
21 | # Check that networking is up. | |
22 | if is_yes "${NETWORKING}"; then | |
23 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then | |
24 | msg_network_down dpcproxy | |
25 | exit 1 | |
26 | fi | |
27 | else | |
28 | exit 0 | |
29 | fi | |
30 | ||
ae960c0e | 31 | start() { |
8c3235ca | 32 | # Start daemons. |
9e9201d7 | 33 | if [ -f /var/lock/subsys/dpcproxy ]; then |
8c3235ca | 34 | msg_already_running dpcproxy |
9e9201d7 | 35 | return |
8c3235ca | 36 | fi |
9e9201d7 ER |
37 | |
38 | msg_starting dpcproxy | |
39 | daemon /usr/sbin/dpcproxy $DPCPROXY_OPTS | |
40 | RETVAL=$? | |
41 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dpcproxy | |
ae960c0e ER |
42 | } |
43 | ||
44 | stop() { | |
8c3235ca | 45 | # Stop daemons. |
9e9201d7 | 46 | if [ ! -f /var/lock/subsys/dpcproxy ]; then |
8c3235ca | 47 | msg_not_running dpcproxy |
9e9201d7 | 48 | return |
ae960c0e | 49 | fi |
9e9201d7 ER |
50 | |
51 | msg_stopping dpcproxy | |
52 | killproc dpcproxy | |
53 | rm -f /var/lock/subsys/dpcproxy >/dev/null 2>&1 | |
ae960c0e ER |
54 | } |
55 | ||
31fd876d | 56 | condrestart() { |
9e9201d7 | 57 | if [! -f /var/lock/subsys/dpcproxy ]; then |
31fd876d ER |
58 | if [ $1 -ne 0 ]; then |
59 | msg_not_running dpcproxy | |
60 | fi | |
61 | RETVAL=$1 | |
9e9201d7 | 62 | return |
31fd876d | 63 | fi |
9e9201d7 ER |
64 | |
65 | stop | |
66 | start | |
31fd876d ER |
67 | } |
68 | ||
ae960c0e ER |
69 | RETVAL=0 |
70 | # See how we were called. | |
71 | case "$1" in | |
72 | start) | |
73 | start | |
74 | ;; | |
75 | stop) | |
76 | stop | |
8c3235ca | 77 | ;; |
31fd876d | 78 | restart) |
ae960c0e ER |
79 | stop |
80 | start | |
8c3235ca | 81 | ;; |
31fd876d ER |
82 | try-restart) |
83 | condrestart 0 | |
84 | ;; | |
85 | force-reload) | |
86 | condrestart 7 | |
87 | ;; | |
8c3235ca AM |
88 | status) |
89 | status dpcproxy | |
90 | exit $? | |
91 | ;; | |
8c3235ca | 92 | *) |
31fd876d | 93 | msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" |
8c3235ca AM |
94 | exit 3 |
95 | esac | |
96 | ||
97 | exit $RETVAL |