SOURCES: dhcp6c.init, dhcp6s.init - use functions

glen glen at pld-linux.org
Sat Dec 15 19:28:17 CET 2007


Author: glen                         Date: Sat Dec 15 18:28:17 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   dhcp6c.init (1.3 -> 1.4) , dhcp6s.init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/dhcp6c.init
diff -u SOURCES/dhcp6c.init:1.3 SOURCES/dhcp6c.init:1.4
--- SOURCES/dhcp6c.init:1.3	Sat Dec 15 19:26:56 2007
+++ SOURCES/dhcp6c.init	Sat Dec 15 19:28:12 2007
@@ -29,10 +29,7 @@
 	exit 0
 fi
 
-RETVAL=0
-
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/dhcp6c ]; then
 		msg_starting "DHCP6C"
@@ -42,8 +39,9 @@
 	else
 		msg_already_running DHCP6C
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/dhcp6c ]; then
 		msg_stopping "DHCP6C Server"
 		killproc dhcp6c
@@ -51,11 +49,19 @@
 	else
 		msg_not_running DHCP6C
 	fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status dhcp6c

================================================================
Index: SOURCES/dhcp6s.init
diff -u SOURCES/dhcp6s.init:1.4 SOURCES/dhcp6s.init:1.5
--- SOURCES/dhcp6s.init:1.4	Sat Dec 15 19:26:56 2007
+++ SOURCES/dhcp6s.init	Sat Dec 15 19:28:12 2007
@@ -30,10 +30,7 @@
 	exit 0
 fi
 
-RETVAL=0
-
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/dhcp6s ]; then
 		msg_starting "DHCP6S"
@@ -43,8 +40,9 @@
 	else
 		msg_already_running DHCP6S
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/dhcp6s ]; then
 		msg_stopping "DHCP6S Server"
 		killproc dhcp6s
@@ -52,11 +50,19 @@
 	else
 		msg_not_running DHCP6S
 	fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status dhcp6s
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/dhcp6c.init?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/dhcp6s.init?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list