SOURCES: gnu-radius.init - use functions

glen glen at pld-linux.org
Mon Oct 9 15:39:03 CEST 2006


Author: glen                         Date: Mon Oct  9 13:39:03 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   gnu-radius.init (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/gnu-radius.init
diff -u SOURCES/gnu-radius.init:1.3 SOURCES/gnu-radius.init:1.4
--- SOURCES/gnu-radius.init:1.3	Sun Oct  8 19:52:59 2006
+++ SOURCES/gnu-radius.init	Mon Oct  9 15:38:57 2006
@@ -27,9 +27,7 @@
 	exit 0
 fi
 
-RETVAL=0
-case "$1" in
-  start)
+start() {
 	if [ ! -f /var/lock/subsys/radius ]; then
 		msg_starting "GNU Radius Server"
 		daemon radiusd -y
@@ -38,8 +36,9 @@
 	else
 		msg_already_running "GNU Radius Server"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/radius ]; then
 		msg_stopping "GNU Radius Server"
 		killproc radiusd
@@ -47,6 +46,15 @@
 	else
 		msg_not_running "GNU Radius Server"
 	fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	status radiusd
@@ -57,9 +65,8 @@
 	killproc radiusd -HUP
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
================================================================

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



More information about the pld-cvs-commit mailing list