[packages/ism] unify

glen glen at pld-linux.org
Thu Sep 26 17:59:10 CEST 2013


commit 9e9201d7b3629febf91fce7b405dcd969d5e8d4d
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Sep 26 18:58:58 2013 +0300

    unify

 dpcproxy.init | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/dpcproxy.init b/dpcproxy.init
index 09b4624..b16b39b 100755
--- a/dpcproxy.init
+++ b/dpcproxy.init
@@ -30,37 +30,40 @@ fi
 
 start() {
 	# Start daemons.
-	if [ ! -f /var/lock/subsys/dpcproxy ]; then
-		msg_starting dpcproxy
-		daemon /usr/sbin/dpcproxy $DPCPROXY_OPTS
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dpcproxy
-	else
+	if [ -f /var/lock/subsys/dpcproxy ]; then
 		msg_already_running dpcproxy
+		return
 	fi
+
+	msg_starting dpcproxy
+	daemon /usr/sbin/dpcproxy $DPCPROXY_OPTS
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dpcproxy
 }
 
 stop() {
 	# Stop daemons.
-	if [ -f /var/lock/subsys/dpcproxy ]; then
-		msg_stopping dpcproxy
-		killproc dpcproxy
-		rm -f /var/lock/subsys/dpcproxy >/dev/null 2>&1
-	else
+	if [ ! -f /var/lock/subsys/dpcproxy ]; then
 		msg_not_running dpcproxy
+		return
 	fi
+
+	msg_stopping dpcproxy
+	killproc dpcproxy
+	rm -f /var/lock/subsys/dpcproxy >/dev/null 2>&1
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/dpcproxy ]; then
-		stop
-		start
-	else
+	if [!  -f /var/lock/subsys/dpcproxy ]; then
 		if [ $1 -ne 0 ]; then
 			msg_not_running dpcproxy
 		fi
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
 }
 
 RETVAL=0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ism.git/commitdiff/9e9201d7b3629febf91fce7b405dcd969d5e8d4d



More information about the pld-cvs-commit mailing list