SOURCES: kdenetwork-lisa.init - use functions

glen glen at pld-linux.org
Sun Oct 1 23:56:21 CEST 2006


Author: glen                         Date: Sun Oct  1 21:56:21 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   kdenetwork-lisa.init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/kdenetwork-lisa.init
diff -u SOURCES/kdenetwork-lisa.init:1.4 SOURCES/kdenetwork-lisa.init:1.5
--- SOURCES/kdenetwork-lisa.init:1.4	Thu Dec  8 02:02:49 2005
+++ SOURCES/kdenetwork-lisa.init	Sun Oct  1 23:56:16 2006
@@ -11,14 +11,13 @@
 #
 # $Id$
 
-
 # Source function library
 . /etc/rc.d/init.d/functions
 
 # Get network config
 . /etc/sysconfig/network
 
-# Get service config - may override defaults
+# Get service config
 [ -f /etc/sysconfig/lisa ] && . /etc/sysconfig/lisa
 
 # Check that networking is up.
@@ -31,10 +30,7 @@
 	exit 0
 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/lisa ]; then
 		msg_starting lisa
@@ -52,8 +48,9 @@
 	else
 		msg_already_running lisa
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/lisa ]; then
 		msg_stopping lisa
@@ -62,11 +59,20 @@
 	else
 		msg_not_running lisa
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status lisa
@@ -80,4 +86,3 @@
 exit $RETVAL
 
 # This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/kdenetwork-lisa.init?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list