aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-xsysconfig/network-scripts/ifup24
1 files changed, 21 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 0380ec9e..d146ca48 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -70,14 +70,32 @@ fi
if [ "$_use_nm" = "true" ]; then
if [ -z "$UUID" ]; then
- echo $"$0: interface ${CONFIG} is controlled by NetworkManager; skipping." >&2
+ # OK, so we are using NM but we have no UUID... not much we can do but
+ # leaving it for now and hoping NM brings it up later
+ echo -n "deferring to NetworkManager " >&2
exit 0
fi
if [ "foo$2" = "fooboot" ] && [ "${TYPE}" = "Wireless" ]; then
+ echo -n "deferring boot-time wireless device to NetworkManager " >&2
exit 0
fi
- is_nm_handling ${DEVICE} && exit 0
- nmcli con up uuid "$UUID"
+
+ # If we don't have a device, this is typically due to removable interface
+ # (e.g. USB ethernet adapters)
+ # This check may apply to non-NM devices too, but I cannot test if this is
+ # valid in all cases so only dealing gracefully with it here.
+ if [ -z "${DEVICE}" ]; then
+ echo -n "no device found: deferring to NetworkManager " >&2
+ exit 0
+ fi
+
+ if is_nm_handling ${DEVICE}; then
+ echo -n "deferred to NetworkManager " >&2
+ exit 0
+ fi
+
+ unset OVERRIDEEXIT
+ nmcli con up uuid "$UUID" 2>&1 | grep -q "no device found for connection" && echo -n "no device found - deferring to NetworkManager " && OVERRIDEEXIT=y; ( [ "y" = "$OVERRIDEEXIT" ] && exit 0; exit ${PIPESTATUS[0]} )
exit $?
fi