]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Cope with greps which do not have "-d skip option" in faxaddmodem, and
authorDarren Nickerson <darren.nickerson@ifax.com>
Tue, 29 Aug 2000 05:53:11 +0000 (05:53 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Tue, 29 Aug 2000 05:53:11 +0000 (05:53 +0000)
fix HylaFAX init script's brain-dead behaviour on non-SysV init
platforms. Contributed by  Lee Howard <faxguy@deanox.com>.

etc/faxaddmodem.sh.in
etc/hylafax.in

index f4174423ccf6c322e500f19b6f6f93cc5e6ed83c..8b2454444858c20ef4f30c4f1c9ad8ca79fcdfb8 100644 (file)
@@ -104,6 +104,18 @@ defPROTOGID=10                     # use this gid if PROTOGID doesn't exist
 MODEMCONFIG=$SPOOL/config      # location of prototype modem config files
 RMCMD="$RM -f"                 # forced removal
 
+#
+# Build a list of config files in a portable way for grepping...
+#
+
+cd $MODEMCONFIG
+CONFIG_LIST=""
+for file in *; do
+  if [ -f "$file" ]; then
+    CONFIG_LIST="$CONFIG_LIST $file"
+  fi
+done
+
 #
 # Prompt the user for a string that can not be null.
 #
@@ -954,7 +966,7 @@ configureClass2Modem()
     getFlowControlConfig
 
     eval `(cd $MODEMCONFIG; \
-       $GREP 'CONFIG:[         ]*CLASS2' * |\
+       $GREP 'CONFIG:[         ]*CLASS2' $CONFIG_LIST |\
        $AWK -F: '
            BEGIN { print "case \"$Manufacturer-$Model-$FlowControl\" in" }
            FILENAME ~ /^OLD/ { next }
@@ -983,7 +995,7 @@ configureClass2dot0Modem()
     getFlowControlConfig
 
     eval `(cd $MODEMCONFIG; \
-       $GREP 'CONFIG:[         ]*CLASS2.0' * |\
+       $GREP 'CONFIG:[         ]*CLASS2.0' $CONFIG_LIST |\
        $AWK -F: '
            BEGIN { print "case \"$Manufacturer-$Model-$FlowControl\" in" }
            FILENAME ~ /^OLD/ { next }
@@ -1012,7 +1024,7 @@ configureClass1Modem()
 
     getFlowControlConfig
 
-    eval `(cd $MODEMCONFIG; $GREP 'CONFIG:[    ]*CLASS1' *) |\
+    eval `(cd $MODEMCONFIG; $GREP 'CONFIG:[    ]*CLASS1' $CONFIG_LIST) |\
        $SED 's/:[      ]*/:/g' |\
        $AWK -F: '
 BEGIN  { proto = "" }
index 38d698f1b30dd7c9966aadc5dff6ffccd728fabf..c8674cd37015a08fb005ed6307a21d016a34a721 100755 (executable)
@@ -146,16 +146,23 @@ fi
 case $1 in
 'start')
        if $IS_ON fax && test -x $FAXQ; then
-           killall -15 faxq
-           killall -15 hfaxd
+           if test $FAXQ_SERVER -eq 1 ; then
+               killall -15 faxq
+           fi
+           if test $HFAXD_SERVER -eq 1 ; then
+               killall -15 hfaxd
+           fi
            printf "HylaFAX:"
             if test $FAXQ_SERVER -eq 1 ; then
                $FAXQ; printf " faxq"
             fi
             if test $HFAXD_SERVER -eq 1 ; then
-               $HFAXD -i $FAXPORT
-            fi
-            printf " hfaxd (without old protocol or SNPP support)"
+               $HFAXD -i $FAXPORT;
+               printf " hfaxd (without old protocol or SNPP support)"
+           fi
+           if test ! $FAXQ_SERVER -eq 1 -a ! $HFAXD_SERVER -eq 1 ; then
+               printf " not started (script disabled by configure)"
+           fi
            $ECHO "."
        fi
        ;;