]> git.pld-linux.org Git - packages/amavisd-new.git/commitdiff
- use FUNCTIONS
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 13 Apr 2007 11:51:12 +0000 (11:51 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    amavisd-new.init -> 1.15

amavisd-new.init

index 6471fee3bcea1cce157370e57a7adae6f1faf58f..aca42f85e1600b3e84a40194648f27eda3aef5ce 100644 (file)
 # Get service config
 [ -f /etc/sysconfig/amavisd ] && . /etc/sysconfig/amavisd
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/amavisd ]; then
                msg_starting Amavisd
-               LC_ALL='' LANG='' LC_TYPE='' LC_CTYPE='' daemon $SERVICE_RUN_NICE_LEVEL /usr/sbin/amavisd -c /etc/amavisd.conf
+               LC_ALL= LANG= LC_TYPE= LC_CTYPE= daemon $SERVICE_RUN_NICE_LEVEL /usr/sbin/amavisd -c /etc/amavisd.conf
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/amavisd
        else
                msg_already_running Amavisd
        fi
+}
+
+stop() {
+       # Stop daemons.
+       if [ -f /var/lock/subsys/amavisd ]; then
+               msg_stopping Amavisd
+               killproc --pidfile amavisd/amavisd.pid amavisd
+               rm -f /var/lock/subsys/amavisd >/dev/null 2>&1
+       else
+               msg_not_running Amavisd
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
        ;;
   stop)
-        # Stop daemons.
-        if [ -f /var/lock/subsys/amavisd ]; then
-                msg_stopping Amavisd
-               killproc --pidfile amavisd/amavisd.pid amavisd
-                rm -f /var/lock/subsys/amavisd >/dev/null 2>&1
-        else
-                msg_not_running Amavisd
-        fi
+       stop
        ;;
   status)
        status amavisd
@@ -59,9 +67,8 @@ case "$1" in
        fi
        ;;
   restart|force-restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-restart|reload|force-reload|status}"
This page took 0.086039 seconds and 4 git commands to generate.