]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[etc/faxaddmodem.sh.in] Escape embeded quotes to fix errors
authorTim Rice <tim@multitalents.net>
Thu, 8 Aug 2002 03:58:48 +0000 (03:58 +0000)
committerTim Rice <tim@multitalents.net>
Thu, 8 Aug 2002 03:58:48 +0000 (03:58 +0000)
faxaddmodem: line 1132: : cannot execute [Is a directory]
faxaddmodem[1132]: [: : unknown operator
[etc/probemodem.sh.in] Bug 327, Remove non portable shell code.
Patch by faxguy@howardsilvan.com

etc/faxaddmodem.sh.in
etc/probemodem.sh.in

index 642665d355e9d4de1548ecde876d667285a3abdd..b0d8abacfc5ae51afbeaf90f5679a535d926a18d 100644 (file)
@@ -1129,7 +1129,7 @@ if [ "$RESULT" = "OK" ]; then
     done;
     MODEMCLASSES=`echo $MODEMCLASSES | $SED -e 's/3/2.0/g' -e 's/4/1.0/g' -e 's/5/2.1/g' -e 's/ $//g'`
     SUPPORT=`echo $SUPPORT | $SED -e 's/3/2.0/g' -e 's/4/1.0/g' -e 's/5/2.1/g'`.
-    if [ "`echo $SUPPORT | $GREP "`" = "" ]; then echo $SUPPORT; fi
+    if [ "`echo $SUPPORT | $GREP \" \"`" = "" ]; then echo $SUPPORT; fi
     case "$MODEMCLASSES" in
     "")                        giveup;;
     "1")               ModemType=Class1; configureClass1Modem;;
@@ -1140,7 +1140,7 @@ if [ "$RESULT" = "OK" ]; then
     *)
        DEFAULTCLASS=`echo $MODEMCLASSES | $SED 's/\([^ ]*\).*/\1/g'`
        x=""
-       while [ "`echo " $MODEMCLASSES " | $GREP " $x "`" = "" ]; do
+       while [ "`echo \" $MODEMCLASSES \" | $GREP \" $x \"`" = "" ]; do
            echo $SUPPORT
            prompt "How should it be configured [$DEFAULTCLASS]?"
            read x
index 47d7156688cf450d109f5e2db6895cf561a05efb..bf3a5c05c83e7ec09bb696c357819beb3592b04e 100644 (file)
@@ -480,17 +480,11 @@ if [ "$RESULT" = "OK" ]; then
     # Class 1 = 1; Class 2 = 2; Class 2.0 = 3;
     # Class 1.0 = 4; Class 2.1 = 5;   
 
-    RESPONSE="`echo $RESPONSE | $SED -e 's/[()]//g'`";
+    RESPONSE="`echo $RESPONSE | $SED -e 's/[()]//g' \
+       -e 's/2.0/3/g' -e 's/1.0/4/g' -e 's/2.1/5/g'`";
     MODEMCLASSES="";
-    CLASS=0;
-    for MATCHSTR in \
-       ",1,|^1,|,1$|^1$" \
-       ",2,|^2,|,2$|^2$" \
-       ",2\.0,|^2\.0,|,2\.0\$|^2\.0\$" \
-       ",1\.0,|^1\.0,|,1\.0\$|^1\.0\$" \
-       ",2\.1,|^2\.1,|,2\.1\$|^2\.1\$"; do
-       CLASS=$[ $CLASS + 1 ];
-       if [ "`echo $RESPONSE | $GREP -E $MATCHSTR`" != "" ]; then
+    for CLASS in 1 2 3 4 5; do
+       if [ "`echo $RESPONSE | $GREP $CLASS`" != "" ]; then
            if [ "$MODEMCLASSES" != "" ]; then
                 SUPPORT=`echo $SUPPORT | $SED 's/ and /, /g'`" and ";
            fi