aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-03-01 16:12:29 -0500
committerBill Nottingham <notting@redhat.com>2010-03-01 16:12:29 -0500
commitb3180a743f5a80c97ea86d4ae3076920aef1c027 (patch)
tree104e61e8bf5556456efdf26b5033bab2b374b3e1 /sysconfig
parent9909d11f0a40b093a2b40e241215436fe71c5fa4 (diff)
downloadinitscripts-b3180a743f5a80c97ea86d4ae3076920aef1c027.tar
initscripts-b3180a743f5a80c97ea86d4ae3076920aef1c027.tar.gz
initscripts-b3180a743f5a80c97ea86d4ae3076920aef1c027.tar.bz2
initscripts-b3180a743f5a80c97ea86d4ae3076920aef1c027.tar.xz
initscripts-b3180a743f5a80c97ea86d4ae3076920aef1c027.zip
Only use UUID to bring connections up/down; ensure we have a UUID by asking NM for it.
Diffstat (limited to 'sysconfig')
-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 d9095dc7..cc5efc97 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 de884ec3..e498553b 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
@@ -139,9 +144,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
}