packages: mythtv/mythbackend.init - formatting

glen glen at pld-linux.org
Sat Jan 22 22:08:30 CET 2011


Author: glen                         Date: Sat Jan 22 21:08:30 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- formatting

---- Files affected:
packages/mythtv:
   mythbackend.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: packages/mythtv/mythbackend.init
diff -u packages/mythtv/mythbackend.init:1.6 packages/mythtv/mythbackend.init:1.7
--- packages/mythtv/mythbackend.init:1.6	Sat Jan 22 22:05:36 2011
+++ packages/mythtv/mythbackend.init	Sat Jan 22 22:08:25 2011
@@ -21,54 +21,62 @@
 
 start() {
 	# Start daemons.
-	if [ ! -f /var/lock/subsys/mythbackend ]; then
-		msg_starting "Mythbackend"
-		daemon /usr/sbin/mythbackend --daemon \
-			--user mythtv \
-			--logfile /var/log/mythtv/mythbackend.log \
-			--pidfile $pidfile \
-			$OPTIONS
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mythbackend
-	else
+	if [ -f /var/lock/subsys/mythbackend ]; then
 		msg_already_running "Mythbackend"
+		return
 	fi
+
+	msg_starting "Mythbackend"
+	daemon /usr/sbin/mythbackend --daemon \
+		--user mythtv \
+		--logfile /var/log/mythtv/mythbackend.log \
+		--pidfile $pidfile \
+		$OPTIONS
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mythbackend
 }
 
 stop() {
 	# Stop daemons.
-	if [ -f /var/lock/subsys/mythbackend ]; then
-		msg_stopping "Mythbackend"
-		killproc --pidfile mythtv/mythbackend.pid mythbackend
-		rm -f /var/lock/subsys/mythbackend /var/run/mythtv/mythbackend.pid >/dev/null 2>&1
-	else
+	if [ ! -f /var/lock/subsys/mythbackend ]; then
 		msg_not_running "Mythbackend"
+		return
+	fi
+
+	msg_stopping "Mythbackend"
+	killproc --pidfile mythtv/mythbackend.pid mythbackend
+	rm -f /var/lock/subsys/mythbackend $pidfile >/dev/null 2>&1
+}
+
+flush-logs() {
+	if [ ! -f /var/lock/subsys/mythbackend ]; then
+		return
 	fi
+
+	show "Rotating %s logs" "Mythbackend"
+	killproc --pidfile $pidfile mythbackend -HUP
 }
 
 RETVAL=0
 # See how we were called.
 case "$1" in
-start)
+  start)
 	start
 	;;
-stop)
+  stop)
 	stop
 	;;
-restart)
+  restart)
 	stop
 	start
 	;;
-flush-logs)
-	if [ -f /var/lock/subsys/mythbackend ]; then
-		show "Rotating %s logs" "Mythbackend"
-		killproc --pidfile mythtv/mythbackend.pid mythbackend -HUP
-	fi
+  flush-logs)
+	flush-logs
+	;;
+  status)
+	status --pidfile $pidfile mythbackend
 	;;
-status)
-	status mythbackend
-;;
-*)
+  *)
 	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
 	exit 3
 esac
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/mythtv/mythbackend.init?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list