SOURCES: icecast.init - use functions

glen glen at pld-linux.org
Sun Mar 18 14:55:51 CET 2007


Author: glen                         Date: Sun Mar 18 13:55:51 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   icecast.init (1.17 -> 1.18) 

---- Diffs:

================================================================
Index: SOURCES/icecast.init
diff -u SOURCES/icecast.init:1.17 SOURCES/icecast.init:1.18
--- SOURCES/icecast.init:1.17	Thu Dec  8 02:02:49 2005
+++ SOURCES/icecast.init	Sun Mar 18 14:55:46 2007
@@ -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/icecast ]; then
 		msg_starting icecast
@@ -42,8 +39,9 @@
 	else
 		msg_already_running Icecast
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/icecast ]; then
 		msg_stopping icecast
@@ -52,10 +50,20 @@
 	else
 		msg_not_running Icecast
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart)
-	$0 stop
-	$0 start
+	stop
+	start
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/icecast ]; then
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/icecast.init?r1=1.17&r2=1.18&f=u



More information about the pld-cvs-commit mailing list