]> git.pld-linux.org Git - packages/ApacheJServ.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 10 Jan 2007 16:12:51 +0000 (16:12 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ApacheJServ.init -> 1.8

ApacheJServ.init

index 115e624b9a7ef2863dc646248b00e5f24b241be7..0044ebe0d8af263ea01972f55a4916d755e726c5 100644 (file)
@@ -36,9 +36,7 @@ getconfig() {
        ENV=$(awk -F= '/^wrapper.env=/{printf("%s=%s\n", $2, $3)}' $JSERV_PROPERTIES)
 }
 
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/jserv ]; then
                msg_starting ApacheJServ
@@ -61,8 +59,9 @@ case "$1" in
        else
                msg_already_running ApacheJServ
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/jserv ]; then
                # Stop daemons.
                msg_stopping ApacheJServ
@@ -71,28 +70,27 @@ case "$1" in
        else
                msg_not_running ApacheJServ
        fi
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
        ;;
-  restart|reload)
-       $0 stop
-       $0 start
-       exit $?
+  stop)
+       stop
        ;;
-  force-reload)
-       # or if it doesn't
-       $0 restart
-
-       exit $?
+  restart)
+       stop
+       start
        ;;
   status)
        status jserv java
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|status}"
        exit 3
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=4:sw=4
This page took 0.080605 seconds and 4 git commands to generate.