SOURCES: policyd.init - use functions

glen glen at pld-linux.org
Tue Dec 26 21:01:43 CET 2006


Author: glen                         Date: Tue Dec 26 20:01:42 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   policyd.init (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/policyd.init
diff -u SOURCES/policyd.init:1.5 SOURCES/policyd.init:1.6
--- SOURCES/policyd.init:1.5	Sat Dec 23 22:27:56 2006
+++ SOURCES/policyd.init	Tue Dec 26 21:01:37 2006
@@ -32,10 +32,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/policyd ]; then
 		msg_starting PolicyD
@@ -45,8 +42,9 @@
 	else
 		msg_already_running PolicyD
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemon.
 	if [ -f /var/lock/subsys/policyd ]; then
 		msg_stopping PolicyD
@@ -55,11 +53,20 @@
 	else
 		msg_not_running PolicyD
 	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 policyd
================================================================

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



More information about the pld-cvs-commit mailing list