Revert "Support adding DHCP interfaces one at a time. "
This reverts commit a1b469b10b
.
This broke testenv deployments - it does not yet work on Ubuntu.
Change-Id: I0f74abc6b99da4b8cabca8ed673c606bae7de0e1
This commit is contained in:
parent
b4e2968aea
commit
39e6f7a5c4
@ -1,10 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
INTERFACE=$1 #optional, if not specified configure all available interfaces
|
|
||||||
ENI_FILE="/etc/network/interfaces"
|
ENI_FILE="/etc/network/interfaces"
|
||||||
|
|
||||||
PATH=/bin:/sbin:$PATH
|
|
||||||
|
|
||||||
if [ -d "/etc/network" ]; then
|
if [ -d "/etc/network" ]; then
|
||||||
CONF_TYPE="eni"
|
CONF_TYPE="eni"
|
||||||
elif [ -d "/etc/sysconfig/network-scripts/" ]; then
|
elif [ -d "/etc/sysconfig/network-scripts/" ]; then
|
||||||
@ -66,17 +63,16 @@ function config_exists() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function inspect_interface() {
|
for interface in $(ls /sys/class/net | grep -v ^lo$) ; do
|
||||||
local interface=$1
|
MAC_ADDR_TYPE="$(cat /sys/class/net/${interface}/addr_assign_type)"
|
||||||
local mac_addr_type="$(cat /sys/class/net/${interface}/addr_assign_type)"
|
|
||||||
|
|
||||||
echo -n "Inspecting interface: $interface..."
|
echo -n "Inspecting interface: $interface..."
|
||||||
if config_exists $interface; then
|
if config_exists $interface; then
|
||||||
echo "Has config, skipping."
|
echo "Has config, skipping."
|
||||||
elif [ "$mac_addr_type" != "0" ]; then
|
elif [ "$MAC_ADDR_TYPE" != "0" ]; then
|
||||||
echo "Device has generated MAC, skipping."
|
echo "Device has generated MAC, skipping."
|
||||||
else
|
else
|
||||||
ip link set dev $interface up &>/dev/null
|
ip link set dev $interface up >/dev/null 2>&1
|
||||||
HAS_LINK="$(get_if_link $interface)"
|
HAS_LINK="$(get_if_link $interface)"
|
||||||
|
|
||||||
TRIES=10
|
TRIES=10
|
||||||
@ -95,13 +91,4 @@ function inspect_interface() {
|
|||||||
disable_interface "$interface"
|
disable_interface "$interface"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -n "$INTERFACE" ]; then
|
|
||||||
inspect_interface $INTERFACE
|
|
||||||
else
|
|
||||||
for iface in $(ls /sys/class/net | grep -v ^lo$); do
|
|
||||||
inspect_interface $iface
|
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user