Bug 23198

Summary: ifup-ipx deuglification
Product: [Retired] Red Hat Linux Reporter: Matthew Kirkwood <matthew>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: rvokal
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-03 00:05:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Kirkwood 2001-01-03 00:05:28 UTC
Hi,

Despite what the comment claims, the author of ifup-ipx probably _was_
smoking some "good floppies" when it was written.

Here's a diff which deuglifies it somewhat (available by email if Netscape
or Bugzilla do bad things to it) by using the usual Bourne shell
associative array idiom:

--- ifup-ipx	Thu Jan 13 15:53:09 2000
+++ /home/matthew/ifup-ipx	Wed Jan  3 00:00:57 2001
@@ -25,18 +25,17 @@
 source_config
 
 for frametype in 802.2 802.3 ETHERII SNAP ; do
-    # Yes, this kind of evaluation is really necessary to do this.
-    # Welcome to shell programming...  No, we were not smoking some
-    # particularly good floppies while we wrote this.  :-)
     framename=$(echo $frametype | sed 's/\./_/')
-    case $(eval echo $(echo \$`echo IPXACTIVE_$framename`)) in
+    eval ACT=\$IPXACTIVE_$framename
+    case $ACT in
 	yes|true)
-		case $(eval echo $(echo \$`echo IPXPRIMARY_$framename`)) in
+		eval PRIM=\$IPXPRIMARY_$framename
+		case $PRIM in
 		    yes|true) primary=-p ;;
 		    *) primary= ;;
 		esac
-		/sbin/ipx_interface add $primary $1 $frametype \
-		  $(eval echo $(echo \$`echo IPXNETNUM_$framename`))
+		eval NUM=\$IPXNETNUM_$framename
+		/sbin/ipx_interface add $primary $1 $frametype $NUM
 		;;
     esac
 done


Cheers,
Matthew.

Comment 1 Bill Nottingham 2001-01-29 22:24:40 UTC
Added in 5.60-1; thanks!

Comment 2 Matthew Kirkwood 2002-08-31 11:37:00 UTC
testing, sorry to bother you