SOURCES: bacula-sd.init - use functions

glen glen at pld-linux.org
Wed Jan 3 10:38:47 CET 2007


Author: glen                         Date: Wed Jan  3 09:38:47 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   bacula-sd.init (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: SOURCES/bacula-sd.init
diff -u SOURCES/bacula-sd.init:1.8 SOURCES/bacula-sd.init:1.9
--- SOURCES/bacula-sd.init:1.8	Wed Jan  3 10:37:42 2007
+++ SOURCES/bacula-sd.init	Wed Jan  3 10:38:42 2007
@@ -14,23 +14,31 @@
 BACULA_SD_GROUP="bacula"
 [ -f /etc/sysconfig/bacula-sd ] && . /etc/sysconfig/bacula-sd
 
-case "$1" in
-start)
+start() {
 	msg_starting "Bacula Storage"
 	daemon /usr/sbin/bacula-sd -u "$BACULA_SD_USER" -g "$BACULA_SD_GROUP" $2 -c /etc/bacula/bacula-sd.conf
 	RETVAL=$?
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-sd
-	;;
-stop)
+}
+
+stop() {
 	msg_stopping "Bacula Storage"
 	killproc /usr/sbin/bacula-sd
 	RETVAL=$?
 	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-sd
+}
+
+case "$1" in
+start)
+	start
+	;;
+stop)
+	stop
 	;;
 restart)
-	$0 stop && sleep 5
-	$0 start
-	RETVAL=$?
+	stop
+   	sleep 5
+	start
 	;;
 status)
 	status /usr/sbin/bacula-sd
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/bacula-sd.init?r1=1.8&r2=1.9&f=u



More information about the pld-cvs-commit mailing list