]> git.pld-linux.org Git - packages/apache.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 1 Oct 2006 21:40:01 +0000 (21:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache.init -> 1.56

apache.init

index c74b3fc766647a75971d2bdfbc7b56c117d4fbdc..d93573a904ddfdb76ce46b5fdcd3e6e57a8ba874 100644 (file)
@@ -39,10 +39,7 @@ if [ -n "${HTTPD_CONF}" ]; then
        fi
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/httpd ]; then
                msg_starting httpd.${HTTPD_MPM}
@@ -52,8 +49,9 @@ case "$1" in
        else
                msg_already_running httpd.${HTTPD_MPM}
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/httpd ]; then
                msg_stopping httpd.${HTTPD_MPM}
@@ -62,6 +60,16 @@ case "$1" in
        else
                msg_not_running httpd.${HTTPD_MPM}
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status httpd.${HTTPD_MPM}
@@ -69,8 +77,8 @@ case "$1" in
        /usr/sbin/httpd.${HTTPD_MPM} $CFG -S
        ;;
   restart)
-       $0 stop
-       $0 start
+       stop
+       start
        ;;
   reload|force-reload|graceful)
        if [ -f /var/lock/subsys/httpd ]; then
This page took 0.040597 seconds and 4 git commands to generate.