]> git.pld-linux.org Git - packages/gld.git/blob - gld.init
- converted to UTF-8
[packages/gld.git] / gld.init
1 #!/bin/sh
2 #
3 # gld           GLD - standalone greylisting server for Postfix
4 #
5 # chkconfig:    2345 79 31
6 # description:  GLD - standalone greylisting server for Postfix
7 #
8 # processname:  gld
9 # pidfile:      /var/run/gld.pid
10 #
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config
19 [ -f /etc/sysconfig/gld ] && . /etc/sysconfig/gld
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 gld
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31 RETVAL=0
32
33 # See how we were called.
34 case "$1" in
35   start)
36         # Check if the service is already running?
37         if [ ! -f /var/lock/subsys/gld ]; then
38                 msg_starting gld
39                 daemon gld $OPTIONS
40                 RETVAL=$?
41                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gld
42         else
43                 msg_already_running gld
44         fi
45         ;;
46   stop)
47         if [ -f /var/lock/subsys/gld ]; then
48                 msg_stopping gld
49                 killproc gld
50                 rm -f /var/lock/subsys/gld >/dev/null 2>&1
51         else
52                 msg_not_running gld
53         fi
54         ;;
55   restart)
56         $0 stop
57         $0 start
58         exit $?
59         ;;
60   reload|force-reload)
61         if [ -f /var/lock/subsys/gld ]; then
62                 msg_reloading gld
63                 killproc gld -HUP
64                 RETVAL=$?
65         else
66                 msg_not_running gld >&2
67                 exit 7
68         fi
69         ;;
70   status)
71         status gld
72         exit $?
73         ;;
74   *)
75         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
76         exit 3
77 esac
78
79 exit $RETVAL
This page took 0.059772 seconds and 3 git commands to generate.