packages: pcsc-lite/pcsc-lite-pcscd.init - unify initscript

glen glen at pld-linux.org
Wed Jan 5 22:33:32 CET 2011


Author: glen                         Date: Wed Jan  5 21:33:32 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unify initscript

---- Files affected:
packages/pcsc-lite:
   pcsc-lite-pcscd.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: packages/pcsc-lite/pcsc-lite-pcscd.init
diff -u packages/pcsc-lite/pcsc-lite-pcscd.init:1.9 packages/pcsc-lite/pcsc-lite-pcscd.init:1.10
--- packages/pcsc-lite/pcsc-lite-pcscd.init:1.9	Wed Jan  5 22:29:57 2011
+++ packages/pcsc-lite/pcsc-lite-pcscd.init	Wed Jan  5 22:33:27 2011
@@ -26,41 +26,44 @@
 # Get service config - may override defaults
 [ -f /etc/sysconfig/pcscd ] && . /etc/sysconfig/pcscd
 
-if is_yes "${LOGGING}"; then
-	LOGOPT="-d"
-else
-	LOGOPT=""
-fi
-
 start() {
-	if [ ! -f /var/lock/subsys/pcscd ]; then
-		msg_starting pcscd
-		daemon pcscd $LOGOPT
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd
+	if [ -f /var/lock/subsys/pcscd ]; then
+		msg_already_running "pcscd"
+		return
+	fi
+
+	if is_yes "${LOGGING}"; then
+		LOGOPT="-d"
 	else
-		msg_already_running pcscd
+		LOGOPT=""
 	fi
+
+	msg_starting "pcscd"
+	daemon /usr/sbin/pcscd $LOGOPT
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd
 }
 
 stop() {
-	if [ -f /var/lock/subsys/pcscd ]; then
-		msg_stopping pcscd
-		killproc pcscd
-		rm -f /var/lock/subsys/pcscd
-	else
-		msg_not_running pcscd
+	if [ ! -f /var/lock/subsys/pcscd ]; then
+		msg_not_running "pcscd"
+		return
 	fi
+
+	msg_stopping "pcscd"
+	killproc pcscd
+	rm -f /var/lock/subsys/pcscd
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/pcscd ]; then
-		stop
-		start
-	else
-		msg_not_running pcscd
+	if [ ! -f /var/lock/subsys/pcscd ]; then
+		msg_not_running "pcscd"
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
 }
 
 RETVAL=0
@@ -85,7 +88,7 @@
 	;;
   status)
 	status pcscd
-	exit $?
+	RETVAL=$?
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
@@ -93,6 +96,3 @@
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/pcsc-lite/pcsc-lite-pcscd.init?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list