SOURCES: dhcp.init - use functions

glen glen at pld-linux.org
Tue Sep 26 21:08:52 CEST 2006


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

---- Files affected:
SOURCES:
   dhcp.init (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: SOURCES/dhcp.init
diff -u SOURCES/dhcp.init:1.13 SOURCES/dhcp.init:1.14
--- SOURCES/dhcp.init:1.13	Mon Jul  7 02:22:46 2003
+++ SOURCES/dhcp.init	Tue Sep 26 21:08:46 2006
@@ -23,10 +23,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/dhcpd ]; then
 		msg_starting "DHCP Server"
@@ -36,8 +33,9 @@
 	else
 		msg_already_running DHCPD
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/dhcpd ]; then
 		msg_stopping "DHCP Server"
 		killproc dhcpd
@@ -45,11 +43,20 @@
 	else
 		msg_not_running DHCPD
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status dhcpd
================================================================

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



More information about the pld-cvs-commit mailing list