diff options
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 9 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup | 9 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 4 |
3 files changed, 22 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index a0cc0c9e..9c9112cb 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -41,6 +41,15 @@ then exit 0 fi +if [ "$USE_NM" = "true" -a -n "$NAME" -o -n "$UUID" ]; then + if [ -n "$UUID" ]; then + nmcli con down uuid "$UUID" + elif [ -n "$NAME" ]; then + nmcli con down id "$NAME" + fi + exit $? +fi + if [ -x /sbin/ifdown-pre-local ]; then /sbin/ifdown-pre-local ${DEVICE} fi diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 2f85e2d0..38915dc6 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -65,6 +65,15 @@ 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 + exit $? +fi + # Ethernet 802.1Q VLAN support if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then VID="" diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index b6a9e1e4..9eace72a 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -133,6 +133,10 @@ 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 $3 }') + [ -n "$UUID" ] && NAME="System ${DEVICE}" + fi } |