script/ethercat.sh
changeset 321 64e20e6e9d0b
parent 299 911f0aed65a9
child 323 d8ac7b1d260e
--- a/script/ethercat.sh	Tue Aug 01 14:15:33 2006 +0000
+++ b/script/ethercat.sh	Tue Aug 01 15:19:11 2006 +0000
@@ -65,7 +65,7 @@
 build_eoe_bridge() {
         if [ -z "$EOE_BRIDGE" ]; then return; fi
 
-	EOE_INTERFACES=`/sbin/ifconfig -a | grep -o -E "^eoe[0-9]+ "`
+	EOEIF=`/sbin/ifconfig -a | grep -o -E "^eoe[0-9]+ "`
 
 	# add bridge, if it does not already exist
 	if ! /sbin/brctl show | grep -E -q "^$EOE_BRIDGE"; then
@@ -76,8 +76,8 @@
 		fi
 	fi
 
-       	# check if specified interfaces are bridged
-	for interf in $EOE_INTERFACES $EOE_EXTRA_INTERFACES; do
+    # check if specified interfaces are bridged
+	for interf in $EOEIF $EOE_EXTRA_INTERFACES; do
 	        # interface is already part of the bridge 
 	        if /sbin/brctl show $EOE_BRIDGE | grep -E -q $interf
 		        then continue
@@ -147,8 +147,12 @@
 	    rc_exit
 	fi
 
-	if [ -z "$EOE_DEVICES" ]; then
-	    EOE_DEVICES=0
+	if [ -z "$EOE_INTERFACES" ]; then
+		if [ -n "$EOE_DEVICES"]; then # support legacy sysconfig files
+			EOE_INTERFACES=$EOE_DEVICES
+		else
+			EOE_INTERFACES=0
+		fi
 	fi
 
 	# unload conflicting modules at first
@@ -163,7 +167,7 @@
 	done
 
 	# load master module
-	if ! modprobe ec_master ec_eoe_devices=$EOE_DEVICES; then
+	if ! modprobe ec_master ec_eoeif_count=$EOE_INTERFACES; then
 	    /bin/false
 	    rc_status -v
 	    rc_exit