]> git.pld-linux.org Git - packages/doldaconnect.git/blob - doldaconnect.init
- init script for doldaconnect
[packages/doldaconnect.git] / doldaconnect.init
1 #!/bin/sh
2 # $Id$
3 #
4 # doldacond:    Direct Connect client as daemon
5 #
6 #
7 # chkconfig:    345 91 09
8 # description:  doldacond
9 #
10 # config:       /etc/sysconfig/doldacond
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get service config
16 if [ -f /etc/sysconfig/doldacond ]; then
17         . /etc/sysconfig/doldacond
18 fi
19
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23                 msg_network_down doldacon
24                 exit 1
25         fi
26 else
27         exit 0
28 fi
29
30 # See how we were called.
31 case "$1" in
32         start)
33                 # Check if service is already running?
34                 if [ ! -f /var/lock/subsys/doldacond ]; then
35                         msg_starting doldacond
36                         daemon doldacond -p /var/run/doldacond.pid ${ADD_OPT}
37                         RETVAL=$?
38                         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/doldacond
39                 else
40                         msg_already_running doldacond
41                 fi
42                 ;;
43         stop)
44                 if [ -f /var/lock/subsys/doldacond ]; then
45                         msg_stopping doldacond
46                         killproc doldacond --pidfile /var/run/doldacond.pid
47                         rm -f /var/lock/subsys/doldacond
48                 else
49                         msg_not_running doldacond
50                 fi
51                 ;;
52         status)
53                 status doldacond
54                 RESULT=$?
55                 ;;
56         reload)
57                 if [ -f /var/lock/subsys/doldacond ]; then
58                         msg_reloading doldacond
59                         killproc doldacond -HUP
60                         RETVAL=$?
61                 else
62                         msg_not_running doldacond >&2
63                         exit 7
64                 fi
65                 ;;
66         restart|force-reload)
67                 $0 stop
68                 $0 start
69                 ;;
70         *)
71                 msg_usage "$0 {start|stop|restart|force-reload|status}"
72                 exit 3
73 esac
74
75 exit 0
This page took 0.552044 seconds and 4 git commands to generate.