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.
#
getFlowControlConfig
eval `(cd $MODEMCONFIG; \
- $GREP 'CONFIG:[ ]*CLASS2' * |\
+ $GREP 'CONFIG:[ ]*CLASS2' $CONFIG_LIST |\
$AWK -F: '
BEGIN { print "case \"$Manufacturer-$Model-$FlowControl\" in" }
FILENAME ~ /^OLD/ { next }
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 }
getFlowControlConfig
- eval `(cd $MODEMCONFIG; $GREP 'CONFIG:[ ]*CLASS1' *) |\
+ eval `(cd $MODEMCONFIG; $GREP 'CONFIG:[ ]*CLASS1' $CONFIG_LIST) |\
$SED 's/:[ ]*/:/g' |\
$AWK -F: '
BEGIN { proto = "" }
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
;;