View | Details | Raw Unified | Return to bug 10656
Collapse All | Expand All

(-)net-general.fix (-8 / +15 lines)
Lines 2-18 Link Here
2
2
3
############ common network helpers
3
############ common network helpers
4
4
5
network_ready()
5
ifdumptool="/etc/net/scripts/contrib/ifdump"
6
network_dhcp_upload()
6
{
7
{
8
	local i
7
	for i in /etc/net/ifaces/*;do
9
	for i in /etc/net/ifaces/*;do
8
		local name=${i##*/}
10
		i="${i##*/}"
9
		[ "$name" != "unknown" ] && [ "$name" != "default" ] || continue
11
		[ "$i" != "unknown" -a "$i" != "default" ] || continue
10
		(/sbin/ip -o link show dev "$name" 2>/dev/null | cut -d' ' -f3 | grep -qs -- '[<,]UP[,>]') || return 1
12
		(eval $("$ifdumptool" "$i")
13
		  [ "$DISABLED" != "yes" ] && [ -z "${BOOTPROTO%%dhcp*}" ] && [ -n "$DHCP_ARGS" ] &&
14
		  {
15
			  	echo "$DHCP_ARGS" |grep -wqs  -- "-H" && exit 1
16
				echo "$DHCP_ARGS" |grep -wqs  -- "-R" || exit 1
17
		  }
18
		) ||
19
		/sbin/ip -o link show dev "$i" 2>/dev/null |cut -d\  -f3 |grep -qs -- '[<,]UP[,>]' ||
20
		{ ifup "$i" && echo "Up $i" >&2; }
11
	done
21
	done
12
	return 0
13
}
22
}
14
23
15
network_ready || /sbin/service network reload >&2
24
network_dhcp_upload
16
25
17
############ main config files
26
############ main config files
18
27
Lines 21-28 Link Here
21
etc_hosts="/etc/hosts"
30
etc_hosts="/etc/hosts"
22
hostnameconfig="/etc/HOSTNAME"
31
hostnameconfig="/etc/HOSTNAME"
23
32
24
ifdumptool="/etc/net/scripts/contrib/ifdump"
25
26
############ helpers: shell config
33
############ helpers: shell config
27
34
28
shell_add_or_subst()
35
shell_add_or_subst()

Return to bug 10656