]> git.pld-linux.org Git - packages/courier-authlib.git/blob - courier-authlib.init
- updated to 0.72.0
[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                 msg_network_down courier-authlib
22                 exit 1
23         fi
24 else
25         exit 0
26 fi
27
28 start() {
29         # Check if the service is already running?
30         if [ -f /var/lock/subsys/courier-authlib ]; then
31                 msg_already_running courier-authlib
32                 return
33         fi
34
35         msg_starting courier-authlib
36         daemon /usr/sbin/authdaemond start
37         RETVAL=$?
38         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-authlib
39 }
40
41 stop() {
42         # Stop daemons.
43         if [ ! -f /var/lock/subsys/courier-authlib ]; then
44                 msg_not_running courier-authlib
45                 return
46         fi
47
48         msg_stopping courier-authlib
49         daemon /usr/sbin/authdaemond stop
50         rm -f /var/lock/subsys/courier-authlib >/dev/null 2>&1
51 }
52
53 reload() {
54         if [ ! -f /var/lock/subsys/courier-authlib ]; then
55                 msg_not_running courier-authlib
56                 RETVAL=7
57                 return
58         fi
59
60         msg_reloading courier-authlib
61         daemon /usr/sbin/authdaemond restart
62         RETVAL=$?
63 }
64
65 condrestart() {
66         if [ ! -f /var/lock/subsys/courier-authlib ]; then
67                 msg_not_running courier-authlib
68                 RETVAL=$1
69                 return
70         fi
71
72         stop
73         start
74 }
75
76 RETVAL=0
77 # See how we were called.
78 case "$1" in
79   start)
80         start
81         ;;
82   stop)
83         stop
84         ;;
85   restart)
86         stop
87         start
88         ;;
89   try-restart)
90         condrestart 0
91         ;;
92   reload|force-reload|graceful)
93         reload
94         ;;
95   status)
96         status authdaemond
97         RETVAL=$?
98         ;;
99   *)
100         msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|try-restart|status}"
101         exit 3
102         ;;
103 esac
104
105 exit $RETVAL
This page took 0.584086 seconds and 3 git commands to generate.