]> git.pld-linux.org Git - packages/wesnoth.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 4 Jan 2007 08:49:36 +0000 (08:49 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    wesnothd.init -> 1.5

wesnothd.init

index 2b00e8d77297534d663f16415b2b5af775443769..cec1e2259eb668179c58534f922fcdf06c438d60 100644 (file)
@@ -11,9 +11,7 @@
 # Get service config
 [ -f /etc/sysconfig/wesnothd ] && . /etc/sysconfig/wesnothd
 
-RETVAL=0
-case "$1" in
-  start)
+start() {
        if [ ! -f /var/lock/subsys/wesnothd ]; then
                msg_starting wesnothd
                daemon "su - wesnothd -s /bin/sh -c '/usr/bin/wesnothd -p 14999 > /dev/null 2>&1 &'"
@@ -22,8 +20,9 @@ case "$1" in
        else
                msg_already_running wesnothd
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/wesnothd ]; then
                msg_stopping wesnothd
                killproc wesnothd
@@ -31,15 +30,23 @@ case "$1" in
        else
                msg_not_running wesnothd
        fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status wesnothd
        exit $?
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
This page took 0.031187 seconds and 4 git commands to generate.