SOURCES: hylafax-init - cleanups, unify

glen glen at pld-linux.org
Fri Oct 13 09:26:35 CEST 2006


Author: glen                         Date: Fri Oct 13 07:26:35 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- cleanups, unify

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

---- Diffs:

================================================================
Index: SOURCES/hylafax-init
diff -u SOURCES/hylafax-init:1.3 SOURCES/hylafax-init:1.4
--- SOURCES/hylafax-init:1.3	Tue Jun 13 11:50:50 2006
+++ SOURCES/hylafax-init	Fri Oct 13 09:26:30 2006
@@ -1,13 +1,13 @@
 #! /bin/sh
 #
-#  hylafax, v 1.2 2001/01/10 Christian Zoffoli <czoffoli at linux-mandrake.com> 
+#  hylafax, v 1.2 2001/01/10 Christian Zoffoli <czoffoli at linux-mandrake.com>
 #
 # chkconfig: 12345 97 05
 # description: HylaFAX(tm) is a sophisticated enterprise-strength fax \
 #              package for class 1 and 2 fax modems on unix systems. \
 #              This init script is the preferred way to start HylaFAX,\
 #              but does not, by default, activate any modems. Consult \
-#              the faxgetty(8) and faxmodem(8) man pages for more info. 
+#              the faxgetty(8) and faxmodem(8) man pages for more info.
 #
 
 SPOOL=/var/spool/fax
@@ -19,13 +19,7 @@
 [ ${NETWORKING} = "no" ] && exit 0
 
 # Source function library.
-if [ -f /etc/init.d/functions ] ; then
-  . /etc/init.d/functions
-elif [ -f /etc/rc.d/init.d/functions ] ; then
-  . /etc/rc.d/init.d/functions
-else
-  exit 0
-fi
+. /etc/rc.d/init.d/functions
 
 checkvar() {
 	if [ ! $1 ]; then
@@ -42,17 +36,17 @@
 check_config()	{
 	test -f $SPOOL/etc/setup.cache || {
 		cat<<-EOF
- 
+
 		HylaFAX FATAL ERROR: $SPOOL/etc/setup.cache is missing!
- 
-		The file $SPOOL/etc/setup.cache is not present. 
-		This probably means the machine has not been setup using the 
+
+		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
 		HylaFAX before you startup a server system.
- 
+
 		EOF
-    		
-		return 1	
+ 
+		return 1
 	}
 
 	# Loading Config
@@ -68,14 +62,12 @@
 	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
 			OUT="$OUT - "
@@ -88,16 +80,14 @@
 	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
-	    	msg="HylaFAX server"
+	if checkvar $HFAXD_SERVER; then
+		msg="HylaFAX server"
 		[ -n "$OUT" ] && msg="$msg $OUT"
 		msg_starting "HylaFAX server"
 		daemon hfaxd $OPTS
@@ -106,29 +96,28 @@
 
 	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/hylafax || RETVAL=1
 
-        return $RETVAL
+	return $RETVAL
 }
 
 stop() {
 	local RETVAL=0
 	local RETVAL2=0
 
-	msg_stopping "HylaFAX queue manager" 
+	msg_stopping "HylaFAX queue manager"
 	daemon /usr/sbin/faxquit
 	RETVAL=$?
 
 	msg_stopping "HylaFAX server"
 	killproc hfaxd
 	RETVAL2=$?
-	
+
 	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/hylafax || RETVAL=1
 	return $RETVAL
 }
 
 faxgettyreset() {
-	if pidofproc faxgetty > /dev/null
-	then
-	    	msg_starting "FaxGetty restart process"
+	if pidofproc faxgetty > /dev/null; then
+		msg_starting "FaxGetty restart process"
 		killproc faxgetty
 		msg_starting "FaxGetty restart process (init reload)"
 		daemon init q
@@ -145,12 +134,14 @@
 
 hstatus() {
 	status hfaxd
+	RETVAL=$?
 	status faxq
+	return $(($RETVAL + $?))
 }
 
-
 check_config || exit 1
 
+RETVAL=0
 case "$1" in
   start)
 	start
@@ -163,6 +154,7 @@
 	;;
   status)
 	hstatus
+	exit $?
 	;;
   condrestart)
 	[ -f /var/lock/subsys/hylafax ] && restart
@@ -177,5 +169,3 @@
 esac
 
 exit 0
-
-
================================================================

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



More information about the pld-cvs-commit mailing list