SOURCES: hylafax-init - avoid syntax errors on empty vars - rechec...

glen glen at pld-linux.org
Fri Oct 13 09:30:32 CEST 2006


Author: glen                         Date: Fri Oct 13 07:30:32 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- avoid syntax errors on empty vars
- recheck LSB stuff

---- Files affected:
SOURCES:
   hylafax-init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/hylafax-init
diff -u SOURCES/hylafax-init:1.4 SOURCES/hylafax-init:1.5
--- SOURCES/hylafax-init:1.4	Fri Oct 13 09:26:30 2006
+++ SOURCES/hylafax-init	Fri Oct 13 09:30:27 2006
@@ -22,12 +22,12 @@
 . /etc/rc.d/init.d/functions
 
 checkvar() {
-	if [ ! $1 ]; then
-		echo -n -e "HylaFAX ERROR (old setup.cache) please run  faxsetup -server\n"
+	if [ ! "$1" ]; then
+		echo -n -e "HylaFAX ERROR (old setup.cache) please run faxsetup -server\n"
 		exit 1
 	fi
 
-	if [ $1 = "yes"  -o  $1 = "1" ]; then
+	if [ $1 = "yes" -o  $1 = "1" ]; then
 		return 0
 	fi
 	return 1
@@ -41,7 +41,7 @@
 
 		The file $SPOOL/etc/setup.cache is not present.
 		This probably means the machine has not been setup using the
-		faxsetup(1M) command.  Read the documentation on setting up
+		faxsetup(1M) command. Read the documentation on setting up
 		HylaFAX before you startup a server system.
 
 		EOF
@@ -58,35 +58,33 @@
 }
 
 start()	{
-	local RETVAL=0
 	local RETVAL2=0
 
 	OPTS="-i hylafax"
-	if checkvar $HFAXD_OLD_PROTOCOL; then
+	if checkvar "$HFAXD_OLD_PROTOCOL"; then
 		OPTS="$OPTS -o 4557"
 		OUT=" OLD Protocol"
 	fi
 
-	if checkvar $HFAXD_SNPP_SERVER; then
+	if checkvar "$HFAXD_SNPP_SERVER"; then
 		OPTS="$OPTS -s snpp"
-		if [ "$OUT" != "" ]; then
+		if [ "$OUT" ]; then
 			OUT="$OUT - "
 		fi
 		OUT="$OUT SNPP"
 	fi
 
-	if [ $OUT ]; then
+	if [ "$OUT" ]; then
 		OUT="( $OUT )"
 	fi
 
-
-	if checkvar $FAXQ_SERVER; then
+	if checkvar "$FAXQ_SERVER"; then
 		msg_starting "HylaFAX queue manager"
 		daemon faxq
 		RETVAL=$?
 	fi
 
-	if checkvar $HFAXD_SERVER; then
+	if checkvar "$HFAXD_SERVER"; then
 		msg="HylaFAX server"
 		[ -n "$OUT" ] && msg="$msg $OUT"
 		msg_starting "HylaFAX server"
@@ -95,11 +93,10 @@
 	fi
 
 	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/hylafax || RETVAL=1
-
-	return $RETVAL
 }
 
 stop() {
+	# stop can't return failure by LSB. so make these vars local
 	local RETVAL=0
 	local RETVAL2=0
 
@@ -111,8 +108,7 @@
 	killproc hfaxd
 	RETVAL2=$?
 
-	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/hylafax || RETVAL=1
-	return $RETVAL
+	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/hylafax
 }
 
 faxgettyreset() {
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/hylafax-init?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list