]> git.pld-linux.org Git - packages/ism.git/blob - dpcproxy.init
09b4624c9ffabb2491b6d439ed7856b9b1f0d34d
[packages/ism.git] / dpcproxy.init
1 #!/bin/sh
2 #
3 # dpcproxy              This shell script takes care of starting and stopping dpcproxy.
4 #
5 # chkconfig:    2345 80 30
6 # description:  dpcproxy is a Intel Server Management cli service
7 #
8 # processname:  dpcproxy
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
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
31 start() {
32         # Start daemons.
33         if [ ! -f /var/lock/subsys/dpcproxy ]; then
34                 msg_starting dpcproxy
35                 daemon /usr/sbin/dpcproxy $DPCPROXY_OPTS
36                 RETVAL=$?
37                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dpcproxy
38         else
39                 msg_already_running dpcproxy
40         fi
41 }
42
43 stop() {
44         # Stop daemons.
45         if [ -f /var/lock/subsys/dpcproxy ]; then
46                 msg_stopping dpcproxy
47                 killproc dpcproxy
48                 rm -f /var/lock/subsys/dpcproxy >/dev/null 2>&1
49         else
50                 msg_not_running dpcproxy
51         fi
52 }
53
54 condrestart() {
55         if [ -f /var/lock/subsys/dpcproxy ]; then
56                 stop
57                 start
58         else
59                 if [ $1 -ne 0 ]; then
60                         msg_not_running dpcproxy
61                 fi
62                 RETVAL=$1
63         fi
64 }
65
66 RETVAL=0
67 # See how we were called.
68 case "$1" in
69   start)
70         start
71         ;;
72   stop)
73         stop
74         ;;
75   restart)
76         stop
77         start
78         ;;
79   try-restart)
80         condrestart 0
81         ;;
82   force-reload)
83         condrestart 7
84         ;;
85   status)
86         status dpcproxy
87         exit $?
88         ;;
89   *)
90         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
91         exit 3
92 esac
93
94 exit $RETVAL
This page took 0.136545 seconds and 2 git commands to generate.