? grep-and-quotes.patch
Index: setvars
===================================================================
RCS file: /cvs/eagleusb/eagleusb/utils/scripts/setvars,v
retrieving revision 1.11
diff -u -r1.11 setvars
--- setvars	16 May 2004 17:48:14 -0000	1.11
+++ setvars	16 May 2004 18:37:50 -0000
@@ -84,8 +84,8 @@
 	. $EU_LANG_DIR/$EU_LANG
 }
 readLangFromConfigFile() {
-	if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "LANG=" $EU_DIR/eagle-usb.conf ; then
-		EU_LANG="`grep 'LANG=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+	if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^LANG=" $EU_DIR/eagle-usb.conf ; then
+		EU_LANG="`grep '^LANG=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 	else
 		# if --with-lang was not specified in ./configure, EU_LANG="auto"
 		EU_LANG="@EU_LANG@"
@@ -96,39 +96,39 @@
 
 # Linetype
 LINETYPE="00000000"
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "Linetype=" $EU_DIR/eagle-usb.conf ; then
-	LINETYPE="`grep 'Linetype=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^Linetype=" $EU_DIR/eagle-usb.conf ; then
+	LINETYPE="`grep '^Linetype=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 fi
 
 # VPI
 VPI="00000000"
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "VPI=" $EU_DIR/eagle-usb.conf ; then
-	VPI="`grep 'VPI=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^VPI=" $EU_DIR/eagle-usb.conf ; then
+	VPI="`grep '^VPI=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 fi
 
 # VCI
 VCI="00000000"
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "VCI=" $EU_DIR/eagle-usb.conf ; then
-	VCI="`grep 'VCI=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^VCI=" $EU_DIR/eagle-usb.conf ; then
+	VCI="`grep '^VCI=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 fi
 
 # ENC + PPPOX (pppoe/pppoa/none)
 ENC="00000000"
 PPPOX="pppoa"
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "Encapsulation=" $EU_DIR/eagle-usb.conf ; then
-	ENC="`grep 'Encapsulation=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^Encapsulation=" $EU_DIR/eagle-usb.conf ; then
+	ENC="`grep '^Encapsulation=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 	encapsToPppox $ENC
 fi
 
 # ISP
 ISP=""
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "ISP=" $EU_DIR/eagle-usb.conf ; then
-	ISP="`grep 'ISP=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^ISP=" $EU_DIR/eagle-usb.conf ; then
+	ISP="`grep '^ISP=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 fi
 
 # FAI_Login
 FAI_LOGIN=""
-if [ -e $PPP_OPTIONS_ADSL ] && grep -q "user" $PPP_OPTIONS_ADSL ; then
+if [ -e $PPP_OPTIONS_ADSL ] && grep -q "^user" $PPP_OPTIONS_ADSL ; then
 	FAI_LOGIN=`grep '^user' $PPP_OPTIONS_ADSL | sed "s/\"/_/g" | sed "s/ /_/g" | sed "s/\t/_/g" | sed -r "s/_+/_/g" | cut -d "_" -f2`
 fi
 
@@ -136,31 +136,31 @@
 FAI_PWD=""
 if [ ! -z "$FAI_LOGIN" ] ; then
 	if [ -e $PPP_DIR/chap-secrets ] ; then
-		FAI_PWD=`grep $FAI_LOGIN $PPP_DIR/chap-secrets | sed "s/ /_/g" | sed "s/\t/_/g" | sed -r "s/_+/_/g" | cut -d "_" -f3`
+		FAI_PWD=`grep "^$FAI_LOGIN" $PPP_DIR/chap-secrets | sed "s/ /_/g" | sed "s/\t/_/g" | sed -r "s/_+/_/g" | cut -d "_" -f3`
 	fi
 	if [ -z "$FAI_PWD" ] && [ -e $PPP_DIR/pap-secrets ] ; then
-		FAI_PWD=`grep $FAI_LOGIN $PPP_DIR/pap-secrets | sed "s/ /_/g" | sed "s/\t/_/g" | sed -r "s/_+/_/g" | cut -d "_" -f3`
+		FAI_PWD=`grep "^$FAI_LOGIN" $PPP_DIR/pap-secrets | sed "s/ /_/g" | sed "s/\t/_/g" | sed -r "s/_+/_/g" | cut -d "_" -f3`
 	fi
 fi
 
 # Password encryption (CHAP)
 PWD_ENCRYPT=0
-if [ -e $PPP_DIR/chap-secrets ] && [ ! -z $FAI_LOGIN ] ; then
-	if grep -q "$FAI_LOGIN" $PPP_DIR/chap-secrets ; then
+if [ -e $PPP_DIR/chap-secrets ] && [ ! -z "$FAI_LOGIN" ] ; then
+	if grep -q "^$FAI_LOGIN" $PPP_DIR/chap-secrets ; then
 		PWD_ENCRYPT=1
 	fi
 fi
 
 # Static IP
 STATIC_IP="none"
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "STATIC_IP=" $EU_DIR/eagle-usb.conf ; then
-	STATIC_IP="`grep 'STATIC_IP=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^STATIC_IP=" $EU_DIR/eagle-usb.conf ; then
+	STATIC_IP="`grep '^STATIC_IP=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 fi
 
 # Asynchronous start
 ASYNCHRONOUS_START=1
-if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "ASYNCHRONOUS_START=" $EU_DIR/eagle-usb.conf ; then
-	ASYNCHRONOUS_START="`grep 'ASYNCHRONOUS_START=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
+if [ -e $EU_DIR/eagle-usb.conf ] && grep -q "^ASYNCHRONOUS_START=" $EU_DIR/eagle-usb.conf ; then
+	ASYNCHRONOUS_START="`grep '^ASYNCHRONOUS_START=' $EU_DIR/eagle-usb.conf | cut -d '=' -f2`"
 fi
 
 # Start on boot?
