#---------------------------------------------------------------------------- # /etc/rc.d/rc305.ip-eth - ip configuration of ethernet cards # /etc/rc.d/ip-eth # # Creation: 04.02.2001 fm # Last Update: $Id$ #---------------------------------------------------------------------------- begin_script IP_NET "configuring ip on network cards ..." if [ ! -f /var/run/wlan.dontuse ]; then > /var/run/wlan.dontuse; fi for idx in `seq 1 $IP_NET_N` do eval dev='$IP_NET_'$idx'_DEV' eval mac='$IP_NET_'$idx'_MAC' eval net='$IP_NET_'$idx'' eval comment='$IP_NET_'$idx'_COMMENT' # leave mac as is, unless otherwise configured if [ -n "$mac" ] then ip link set dev $dev addr $mac fi # Put comment into netaliases.conf file if [ -n "$comment" ] then comment=`echo $comment | sed 's/ /_/g'` net_alias_add "$comment" $dev fi # if no ip address, skip configuration if [ -z "`grep $dev /var/run/wlan.dontuse`" ] then case "$net" in '') ;; dhcp) log_info "$dev will be configured by dhcp client, leaving it untouched" ;; *) broadcast=`netcalc broadcast $net` ip addr add $net broadcast $broadcast dev $dev ip link set $dev up ;; esac else log_error "skipping device $dev because of previous error on wlan-setup for security reasons" fi done end_script