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

(-)a/functions (-1 / +7 lines)
Lines 196-201 iface_is_up() Link Here
196
	$IP -o link show dev $NAME 2>/dev/null | cut -d' ' -f3 | grep -qs '[<,]UP[,>]'
196
	$IP -o link show dev $NAME 2>/dev/null | cut -d' ' -f3 | grep -qs '[<,]UP[,>]'
197
}
197
}
198
198
199
iface_have_ipaddr()
200
{
201
	local NAME=${1:?missing 1st argument to $FUNCNAME}
202
	$IP -o addr show dev $NAME 2>/dev/null | egrep -qs " $NAME +inet ([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2} "
203
}
204
199
# Invoke program which understands the "-o NAME" option -
205
# Invoke program which understands the "-o NAME" option -
200
# insmod for modutils, modprobe for module-init-tools.
206
# insmod for modutils, modprobe for module-init-tools.
201
modprobe_with_rename()
207
modprobe_with_rename()
Lines 494-500 eval_string() Link Here
494
500
495
declare -frx is_yes is_no SourceIfNotEmpty ExecIfExecutable supported_type name2type
501
declare -frx is_yes is_no SourceIfNotEmpty ExecIfExecutable supported_type name2type
496
declare -frx pickup_options print_error print_message print_progress print_nack
502
declare -frx pickup_options print_error print_message print_progress print_nack
497
declare -frx iface_is_up try_rmmod get_mapped_ifname profiled_filename init_netprofile
503
declare -frx iface_is_up iface_have_ipaddr try_rmmod get_mapped_ifname profiled_filename init_netprofile
498
declare -frx init_nethost foreach_child ifdown_children ifup_children ifup_parents
504
declare -frx init_nethost foreach_child ifdown_children ifup_children ifup_parents
499
declare -frx ifdown_parents iface_exists seen_iface add_seen_iface xargise_file
505
declare -frx ifdown_parents iface_exists seen_iface add_seen_iface xargise_file
500
declare -frx have_ifplugd pickup_defaults trim need_detection stop_dhcp_client
506
declare -frx have_ifplugd pickup_defaults trim need_detection stop_dhcp_client
(-)a/ifup-removable (+4 lines)
Lines 52-57 export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES Link Here
52
init_netprofile
52
init_netprofile
53
if [ ! -d "$MYIFACEDIR" ]; then
53
if [ ! -d "$MYIFACEDIR" ]; then
54
	if is_yes "$ALLOW_UNKNOWN"; then
54
	if is_yes "$ALLOW_UNKNOWN"; then
55
		if iface_is_up $NAME && iface_have_ipaddr $NAME; then
56
			print_message -n "unknown interface '$NAME' already configured - skipping (lookup ALLOW_UNKNOWN_RESET option or create a usable configuration)"
57
			exit 1
58
		fi
55
		if [ -d $IFACEDIR/unknown@$NETHOST ]; then
59
		if [ -d $IFACEDIR/unknown@$NETHOST ]; then
56
			MYIFACEDIR=$IFACEDIR/unknown@$NETHOST
60
			MYIFACEDIR=$IFACEDIR/unknown@$NETHOST
57
		else
61
		else

Return to bug 16461