aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-03-01 16:12:29 -0500
committerBill Nottingham <notting@redhat.com>2010-04-09 16:36:26 -0400
commit72e6ee50fff7d9e1e52b04f5b6fbbe33f9348e44 (patch)
treea0b7adea12775b84b306d030079878b27221c2c6
parenta3e30fe40f147a9718d04e19455b89314de6dd8f (diff)
downloadinitscripts-72e6ee50fff7d9e1e52b04f5b6fbbe33f9348e44.tar
initscripts-72e6ee50fff7d9e1e52b04f5b6fbbe33f9348e44.tar.gz
initscripts-72e6ee50fff7d9e1e52b04f5b6fbbe33f9348e44.tar.bz2
initscripts-72e6ee50fff7d9e1e52b04f5b6fbbe33f9348e44.tar.xz
initscripts-72e6ee50fff7d9e1e52b04f5b6fbbe33f9348e44.zip
Only use UUID to bring connections up/down; ensure we have a UUID by asking NM for it.
-rwxr-xr-xsysconfig/network-scripts/ifup8
-rw-r--r--sysconfig/network-scripts/network-functions10
2 files changed, 9 insertions, 9 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 1b4f800a..ffbd376d 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -65,12 +65,8 @@ then
exit 0
fi
-if [ "$USE_NM" = "true" -a -n "$NAME" -o -n "$UUID" ]; then
- if [ -n "$UUID" ]; then
- nmcli con up uuid "$UUID"
- elif [ -n "$NAME" ]; then
- nmcli con up id "$NAME"
- fi
+if [ "$USE_NM" = "true" -a -n "$UUID" ]; then
+ nmcli con up uuid "$UUID"
exit $?
fi
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 76ce9fb8..8e5a3b53 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -54,6 +54,11 @@ get_device_by_hwaddr ()
LANG=C ip -o link | grep -v link/ieee802.11 | awk -F ': ' -vIGNORECASE=1 "/$1/ { print \$2 }"
}
+get_uuid_by_config ()
+{
+ dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/$1" | awk -F '"' '/string / { print $2 }'
+}
+
need_config ()
{
local nconfig
@@ -133,9 +138,8 @@ source_config ()
ISALIAS=no
fi
is_nm_running && USE_NM=true
- if [ -z "$NAME" -a "$USE_NM" = "true" ]; then
- UUID=$(nmcli -t con list id "System ${DEVICE}" 2>/dev/null| awk '/uuid :/ { print gensub("\"","","g",$3) }')
- [ -n "$UUID" ] && NAME="System ${DEVICE}"
+ if [ -z "$UUID" -a "$USE_NM" = "true" ]; then
+ UUID=$(get_uuid_by_config $CONFIG)
fi
}