--- net-general.fix 2007-01-12 23:51:34 +0300 +++ net-general 2007-01-13 00:46:02 +0300 @@ -2,17 +2,26 @@ ############ common network helpers -network_ready() +ifdumptool="/etc/net/scripts/contrib/ifdump" +network_dhcp_upload() { + local i for i in /etc/net/ifaces/*;do - local name=${i##*/} - [ "$name" != "unknown" ] && [ "$name" != "default" ] || continue - (/sbin/ip -o link show dev "$name" 2>/dev/null | cut -d' ' -f3 | grep -qs -- '[<,]UP[,>]') || return 1 + i="${i##*/}" + [ "$i" != "unknown" -a "$i" != "default" ] || continue + (eval $("$ifdumptool" "$i") + [ "$DISABLED" != "yes" ] && [ -z "${BOOTPROTO%%dhcp*}" ] && [ -n "$DHCP_ARGS" ] && + { + echo "$DHCP_ARGS" |grep -wqs -- "-H" && exit 1 + echo "$DHCP_ARGS" |grep -wqs -- "-R" || exit 1 + } + ) || + /sbin/ip -o link show dev "$i" 2>/dev/null |cut -d\ -f3 |grep -qs -- '[<,]UP[,>]' || + { ifup "$i" && echo "Up $i" >&2; } done - return 0 } -network_ready || /sbin/service network reload >&2 +network_dhcp_upload ############ main config files @@ -21,8 +30,6 @@ etc_hosts="/etc/hosts" hostnameconfig="/etc/HOSTNAME" -ifdumptool="/etc/net/scripts/contrib/ifdump" - ############ helpers: shell config shell_add_or_subst()