]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Lee Howard and Giulio Orsero's patch to address [Bug 56] and [Bug 57] (fuser
authorDarren Nickerson <darren.nickerson@ifax.com>
Sun, 24 Sep 2000 18:38:23 +0000 (18:38 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Sun, 24 Sep 2000 18:38:23 +0000 (18:38 +0000)
and verifyModemRate() bogosity)

configure
defs.in
etc/faxaddmodem.sh.in
etc/faxsetup.sh.in

index 17a69c46bc74c8f88dabb3b0aa9ce7d885e98461..d68087a82510db0ce4fc5f99ab0b2d1f29e3f73c 100755 (executable)
--- a/configure
+++ b/configure
@@ -149,6 +149,7 @@ FAXUID
 FILLORDER
 FONTMAP
 FONTPATH       PATH_AFM
+FUSER
 GETTY
 GREP
 GSRIP          PATH_GSRIP
@@ -3285,6 +3286,7 @@ test "$CMP"       || CMP=`findAppDef cmp $PATH cmp`
 test "$COL"    || COL=`findAppDef col $PATH col`
 test "$CP"     || CP=`findAppDef cp $PATH cp`
 test "$ECHO"   || ECHO=`findAppDef echo $PATH echo`
+test "$FUSER"  || FUSER=`findAppDef fuser /sbin:$PATH fuser`
 test "$GENDIST"        || GENDIST=`findAppDef gendist $PATH gendist`
 test "$GREP"   || GREP=`findAppDef grep $PATH grep`
 test "$LN"     || LN=`findAppDef ln $PATH ln`
diff --git a/defs.in b/defs.in
index 3ce79a75d2e7f286308d6c48ff2f29957c46839c..134b7155fa699dcb93788d1955ef2313026c61e5 100644 (file)
--- a/defs.in
+++ b/defs.in
@@ -76,6 +76,7 @@ MKDEPEND      = @MKDEPEND@
 #
 INSTALL                = @INSTALL@
 ECHO           = @ECHO@
+FUSER          = @FUSER@
 GREP           = @GREP@
 RM             = @RM@
 PWD            = @PWD@
index 99408e3f1f38e4ffab97eca63848fb5b2977eb0e..0c98d02cc59bd37c5ff586038525db280397d6fb 100644 (file)
@@ -55,6 +55,21 @@ while [ x"$1" != x"" ] ; do
     shift
 done
 
+# Test selected modem speed against a list of known standards
+
+if [ "$SPEED" != "" -a "$SPEED" != 38400 -a "$SPEED" != 19200 \
+   -a "$SPEED" != 9600 -a "$SPEED" != 4800 -a "$SPEED" != 2400 \
+   -a "$SPEED" != 1200 ]; then
+   cat<<EOF
+
+Warning, you have selected a DTE-DCE communication rate ($SPEED) that
+differs from known standards. $SPEED may not work correctly for sending
+and receiving facsimile: check your modem manual to make sure that
+$SPEED is acceptable.
+
+EOF
+fi
+
 test -f $SPOOL/etc/setup.cache || {
     cat<<EOF
 
@@ -284,15 +299,17 @@ LOCKSTR=`expr "         $$" : '.*\(..........\)'`
 for x in $LOCKX; do
     echo "$LOCKSTR" > $x
 done
+
 # zap any gettys or other users
-fuser -k $DEVS >/dev/null 2>&1 || {
+if ! [ -f $FUSER ]; then
     cat<<EOF
 Hmm, there does not appear to be an fuser command on your machine.
-This means that I am unable to insure that all processes using the
+This means that I am unable to ensure that all processes using the
 modem have been killed.  I will keep going, but beware that you may
 have competition for the modem.
 EOF
-}
+else $FUSER -k $DEVS >/dev/null 2>&1
+fi
 
 cat<<EOF
 
@@ -1487,37 +1504,6 @@ $3 != ""{ p($1, $2) }
 END    { printf "\n" }'
 }
 
-verifyModemRate()
-{
-    if [ "$ModemRate" != "$SPEED" ]; then
-       cat<<EOF
-
-Hmmm, the configured DTE-DCE communication rate ($ModemRate) is
-different than the rate that we are using to setup the modem ($SPEED).
-
-EOF
-       while [ "$ModemRate" != "$SPEED" ]; do
-           prompt "Are you sure you want to use $ModemRate as the DTE-DCE baud rate [yes]?"; read x
-           isOK $x && break
-           # Next time prompt for the speed we established earlier.
-           ModemRate=$SPEED
-           promptFor Numeric ModemRate "DTE-DCE communication baud rate"
-       done
-    fi
-    if [ "$ModemRate" != "$protoModemRate" ]; then
-       cat<<EOF
-
-Warning, the prototype configuration for your modem uses a different
-DTE-DCE communication rate ($protoModemRate) than the rate that you have
-selected ($ModemRate).  Unless this prototype configuration file is setup
-to automatically switch baud rates for facsimile communication, $ModemRate
-may not work correctly for sending and receiving facsimile: check your
-modem manual to make sure that $ModemRate is acceptable.
-
-EOF
-    fi
-}
-
 promptFor()
 {
     eval test \"\$proto$2\" && {
@@ -1588,7 +1574,6 @@ AT        ModemOnHookCmd          Command for placing phone \"on hook\" (hangup)
 #      ModemPageDoneTimeout    Page send/receive timeout (ms)
 #      ModemPageStartTimeout   Page send/receive timeout (ms)
 #      ModemRate               DTE-DCE communication baud rate
-       verifyModemRate
 BO     ModemRecvFillOrder      \
        Bit order that modem sends received facsimile data
 AT     ModemResetCmds          Additional commands for resetting the modem
@@ -1725,7 +1710,6 @@ while isNotOK $ok; do
     #
     prompt "Are these ok [yes]?"; read ok
 done
-verifyModemRate
 TMPSED=$TMPDIR/faxsed$$; JUNK="$JUNK $TMPSED"
 (echoServerSedCommands; echoModemSedCommands)>$TMPSED
 
index cfd81d01bc298d4b4e4f0091ecefcbc28e9b51bd..e5293ec1da4a3ee34aa3140863a6e8c1698e4af0 100644 (file)
@@ -55,6 +55,7 @@ CHMOD=@CHMOD@                 # change file mode for use below
 CHOWN=@CHOWN@                  # change file owner for use below
 CP=@CP@                                # cp command for use below
 ECHO=@ECHO@                    # echo command for use below
+FUSER=@FUSER@                  # fuser command to dump in setup.cache
 GREP=@GREP@                    # grep command for use below
 LN=@LN@                                # ln command for use below
 LN_S=@LN_S@                    # ln option for creating a symbolic link
@@ -130,6 +131,7 @@ CP
 DPSRIP         PATH_DPSRIP
 ECHO
 FAXQ_SERVER
+FUSER
 GREP
 GSRIP          PATH_GSRIP
 HFAXD_SERVER