]> git.pld-linux.org Git - packages/courier-authlib.git/blob - courier-authlib.init
- update
[packages/courier-authlib.git] / courier-authlib.init
1 #!/bin/sh
2 #
3 # courier-authlib       courier-authlib
4 #
5 # chkconfig:    345 85 15
6 # description:  courier-authlib 
7 #
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 # Get network config
13 . /etc/sysconfig/network
14
15 # Get service config
16 [ -f /etc/sysconfig/courier-authlib ] && . /etc/sysconfig/courier-authlib
17
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21                 # nls "ERROR: Networking is down. %s can't be run." <service>
22                 msg_network_down courier-authlib
23                 exit 1
24         fi
25 else
26         exit 0
27 fi
28
29 RETVAL=0
30 # See how we were called.
31 case "$1" in
32   start)
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/courier-authlib ]; then
35                 msg_starting courier-authlib
36                 daemon /usr/sbin/authdaemond start
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-authlib
39         else
40                 msg_already_running courier-authlib
41         fi
42         ;;
43   stop)
44         # Stop daemons.
45         if [ -f /var/lock/subsys/courier-authlib ]; then
46                 msg_stopping courier-authlib
47                 daemon /usr/sbin/authdaemond stop
48                 rm -f /var/lock/subsys/courier-authlib >/dev/null 2>&1
49         else
50                 msg_not_running courier-authlib
51         fi
52         ;;
53   status)
54         status authdaemond
55         RETVAL=$?
56         ;;
57   restart)
58         $0 stop
59         $0 start
60         ;;
61   reload|force-reload|graceful)
62         if [ -f /var/lock/subsys/courier-authlib ]; then
63                 msg_reloading courier-authlib
64                 daemon /usr/sbin/authdaemond restart
65                 RETVAL=$?
66         else
67                 msg_not_running courier-authlib
68                 RETVAL=7
69         fi
70         ;;
71   *)
72         msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
73         exit 3
74         ;;
75 esac
76
77 exit $RETVAL
This page took 0.079323 seconds and 3 git commands to generate.