SOURCES: nscd.init - use functions

glen glen at pld-linux.org
Wed Feb 28 21:58:05 CET 2007


Author: glen                         Date: Wed Feb 28 20:58:05 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   nscd.init (1.12 -> 1.13) 

---- Diffs:

================================================================
Index: SOURCES/nscd.init
diff -u SOURCES/nscd.init:1.12 SOURCES/nscd.init:1.13
--- SOURCES/nscd.init:1.12	Thu Dec  8 02:02:49 2005
+++ SOURCES/nscd.init	Wed Feb 28 21:57:59 2007
@@ -21,10 +21,7 @@
 # Get sysconfig
 [ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	if [ ! -f /var/lock/subsys/nscd ]; then
 		msg_starting "Name Switch Cache Daemon"
 		daemon nscd
@@ -33,8 +30,9 @@
 	else
 		msg_already_running "Name Switch Cache Daemon"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/nscd ]; then
 		msg_stopping "Name Switch Cache Daemon"
 		busy
@@ -44,15 +42,24 @@
 	else
 		msg_not_running "Name Switch Cache Daemon"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	status nscd
 	exit $?
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|force-reload|status}"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/nscd.init?r1=1.12&r2=1.13&f=u



More information about the pld-cvs-commit mailing list