SOURCES: ddclient.init - use functions

glen glen at pld-linux.org
Tue Sep 26 21:07:06 CEST 2006


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

---- Files affected:
SOURCES:
   ddclient.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/ddclient.init
diff -u SOURCES/ddclient.init:1.6 SOURCES/ddclient.init:1.7
--- SOURCES/ddclient.init:1.6	Sun Sep 17 18:17:31 2006
+++ SOURCES/ddclient.init	Tue Sep 26 21:07:01 2006
@@ -26,10 +26,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/ddclient ]; then
 		msg_starting "Dynamic DNS Client"
@@ -39,8 +36,9 @@
 	else
 		msg_already_running "Dynamic DNS Client"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/ddclient ]; then
 		msg_stopping "Dynamic DNS Client"
 		killproc ddclient
@@ -48,11 +46,20 @@
 	else
 		msg_not_running "Dynamic DNS Client"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+	stop
 	;;
   restart)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status ddclient
================================================================

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



More information about the pld-cvs-commit mailing list