SOURCES: cups.init - use functions

glen glen at pld-linux.org
Tue Sep 26 21:05:23 CEST 2006


Author: glen                         Date: Tue Sep 26 19:05:23 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   cups.init (1.22 -> 1.23) 

---- Diffs:

================================================================
Index: SOURCES/cups.init
diff -u SOURCES/cups.init:1.22 SOURCES/cups.init:1.23
--- SOURCES/cups.init:1.22	Tue May 30 13:40:40 2006
+++ SOURCES/cups.init	Tue Sep 26 21:05:18 2006
@@ -1,6 +1,5 @@
 #!/bin/sh
 #
-#
 # cups		Common UNIX Printing System (CUPS)
 #
 # chkconfig:	2345 90 10
@@ -28,10 +27,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/cups ]; then
 		msg_starting CUPS
@@ -41,8 +37,9 @@
 	else
 		msg_already_running CUPS
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/cups ]; then
 		msg_stopping CUPS
@@ -51,11 +48,20 @@
 	else
 		msg_not_running CUPS
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/cups ]; then
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/cups.init?r1=1.22&r2=1.23&f=u



More information about the pld-cvs-commit mailing list