]> git.pld-linux.org Git - packages/courier-authlib.git/blob - courier-authlib.init
- release 3
[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_starting courier-authlib
32                 daemon /usr/sbin/authdaemond start
33                 RETVAL=$?
34                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-authlib
35         else
36                 msg_already_running courier-authlib
37         fi
38 }
39
40 stop() {
41         # Stop daemons.
42         if [ -f /var/lock/subsys/courier-authlib ]; then
43                 msg_stopping courier-authlib
44                 daemon /usr/sbin/authdaemond stop
45                 rm -f /var/lock/subsys/courier-authlib >/dev/null 2>&1
46         else
47                 msg_not_running courier-authlib
48         fi
49 }
50
51 RETVAL=0
52 # See how we were called.
53 case "$1" in
54   start)
55         start
56         ;;
57   stop)
58         stop
59         ;;
60   status)
61         status authdaemond
62         RETVAL=$?
63         ;;
64   restart)
65         stop
66         start
67         ;;
68   reload|force-reload|graceful)
69         if [ -f /var/lock/subsys/courier-authlib ]; then
70                 msg_reloading courier-authlib
71                 daemon /usr/sbin/authdaemond restart
72                 RETVAL=$?
73         else
74                 msg_not_running courier-authlib
75                 RETVAL=7
76         fi
77         ;;
78   *)
79         msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
80         exit 3
81         ;;
82 esac
83
84 exit $RETVAL
This page took 0.071008 seconds and 3 git commands to generate.