diff -r bc89e3fba1a5 -r 5fcbd29151d2 script/ethercat.sh --- a/script/ethercat.sh Tue Feb 13 13:36:31 2007 +0000 +++ b/script/ethercat.sh Tue Feb 13 13:42:37 2007 +0000 @@ -49,6 +49,12 @@ #------------------------------------------------------------------------------ +IFCONFIG=ifconfig +BRCTL=brctl +ROUTE=route + +#------------------------------------------------------------------------------ + ETHERCAT_CONFIG=/etc/sysconfig/ethercat if [ ! -r $ETHERCAT_CONFIG ]; then @@ -71,11 +77,11 @@ { if [ -z "$EOE_BRIDGE" ]; then return; fi - EOEIF=`/sbin/ifconfig -a | grep -o -E "^eoe[0-9]+ "` + EOEIF=`$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 - if ! /sbin/brctl addbr $EOE_BRIDGE; then + if ! $BRCTL show | grep -E -q "^$EOE_BRIDGE"; then + if ! $BRCTL addbr $EOE_BRIDGE; then /bin/false rc_status -v rc_exit @@ -84,18 +90,18 @@ # 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 + # interface is already part of the bridge (FIXME->show $EOE_BRIDGE) + if $BRCTL show | grep -E -q $interf then continue fi # clear IP address and open interface - if ! /sbin/ifconfig $interf 0.0.0.0 up; then + if ! $IFCONFIG $interf 0.0.0.0 up; then /bin/false rc_status -v rc_exit fi # add interface to the bridge - if ! /sbin/brctl addif $EOE_BRIDGE $interf; then + if ! $BRCTL addif $EOE_BRIDGE $interf; then /bin/false rc_status -v rc_exit @@ -104,7 +110,7 @@ # configure IP on bridge if [ -n "$EOE_IP_ADDRESS" -a -n "$EOE_IP_NETMASK" ]; then - if ! /sbin/ifconfig $EOE_BRIDGE $EOE_IP_ADDRESS \ + if ! $IFCONFIG $EOE_BRIDGE $EOE_IP_ADDRESS \ netmask $EOE_IP_NETMASK; then /bin/false rc_status -v @@ -113,7 +119,7 @@ fi # open bridge - if ! /sbin/ifconfig $EOE_BRIDGE up; then + if ! $IFCONFIG $EOE_BRIDGE up; then /bin/false rc_status -v rc_exit @@ -121,15 +127,15 @@ # install new default gateway if [ -n "$EOE_GATEWAY" ]; then - while /sbin/route -n | grep -E -q "^0.0.0.0"; do - if ! /sbin/route del default; then + while $ROUTE -n | grep -E -q "^0.0.0.0"; do + if ! $ROUTE del default; then echo "Failed to remove route!" 1>&2 /bin/false rc_status -v rc_exit fi done - if ! /sbin/route add default gw $EOE_GATEWAY; then + if ! $ROUTE add default gw $EOE_GATEWAY; then /bin/false rc_status -v rc_exit