SOURCES: zaptel.init - use functions

glen glen at pld-linux.org
Tue Mar 13 16:10:12 CET 2007


Author: glen                         Date: Tue Mar 13 15:10:12 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   zaptel.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/zaptel.init
diff -u SOURCES/zaptel.init:1.2 SOURCES/zaptel.init:1.3
--- SOURCES/zaptel.init:1.2	Wed Sep  8 06:29:46 2004
+++ SOURCES/zaptel.init	Tue Mar 13 16:10:07 2007
@@ -13,10 +13,7 @@
 # Get service config
 [ -f /etc/sysconfig/zaptel ] && . /etc/sysconfig/zaptel
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/zaptel ]; then
 		msg_starting zaptel
@@ -31,8 +28,9 @@
 	else
 		msg_already_running zaptel
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/zaptel ]; then
 		msg_stopping zaptel
@@ -48,13 +46,23 @@
 	else
 		msg_not_running zaptel
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	RETVAL=0
 	;;
   restart)
-  	$0 stop
-	$0 start
+  	stop
+	start
 	;;
   reload|force-reload|graceful)
 	if [ -f /var/lock/subsys/zaptel ]; then
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/zaptel.init?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list