Merge "ifquery doesn't exist on Fedora"

This commit is contained in:
Jenkins 2014-02-12 03:11:43 +00:00 committed by Gerrit Code Review
commit eab085af02

View File

@ -50,11 +50,24 @@ function disable_interface() {
fi fi
} }
function config_exists() {
local interface=$1
if [ "$CONF_TYPE" == "netscripts" ]; then
if [ -f "/etc/sysconfig/network-scripts/ifcfg-$interface" ]; then
return 0
else
return 1
fi
else
return ifquery $interface >/dev/null 2>&1
fi
}
for interface in $(ls /sys/class/net | grep -v ^lo$) ; do for interface in $(ls /sys/class/net | grep -v ^lo$) ; do
MAC_ADDR_TYPE="$(cat /sys/class/net/${interface}/addr_assign_type)" MAC_ADDR_TYPE="$(cat /sys/class/net/${interface}/addr_assign_type)"
echo -n "Inspecting interface: $interface..." echo -n "Inspecting interface: $interface..."
if ifquery $interface >/dev/null 2>&1 ; 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."