Blame SOURCES/hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch

80f447
From 2db75ec41c2e346af992f9c00f2e90ed9fec694b Mon Sep 17 00:00:00 2001
80f447
From: Till Maas <timaas@redhat.com>
80f447
Date: Mon, 13 Dec 2021 16:08:42 +0000
80f447
Subject: [PATCH 1/2] hv_set_ifconfig.sh: Use nmcli commands
80f447
80f447
RH-Author: Mohamed Gamal Morsy <mmorsy@redhat.com>
80f447
RH-MergeRequest: 2: hv_set_ifconfig.sh: Use nmcli commands
80f447
RH-Commit: [1/2] c045f4c849a7d8841c8ad4b6e4ba63abfb946187
80f447
RH-Bugzilla: 2056566
80f447
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
80f447
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
80f447
80f447
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2056566
80f447
80f447
Instead of using deprecated ifup/ifdown commands, use nmcli commands.
80f447
Taking the connection down is not necessary with NM, so don't do it.
80f447
80f447
Signed-off-by: Till Maas <tmaas@redhat.com>
80f447
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
80f447
---
80f447
 hv_set_ifconfig.sh | 7 ++-----
80f447
 1 file changed, 2 insertions(+), 5 deletions(-)
80f447
80f447
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
80f447
index 3dd064c..5a64efe 100644
80f447
--- a/hv_set_ifconfig.sh
80f447
+++ b/hv_set_ifconfig.sh
80f447
@@ -57,8 +57,5 @@ echo "ONBOOT=yes" >> $1
80f447
 
80f447
 cp $1 /etc/sysconfig/network-scripts/
80f447
 
80f447
-
80f447
-interface=$(echo $1 | awk -F - '{ print $2 }')
80f447
-
80f447
-/sbin/ifdown $interface 2>/dev/null
80f447
-/sbin/ifup $interface 2>/dev/null
80f447
+nmcli connection load "/etc/sysconfig/network-scripts/$1"
80f447
+nmcli connection up filename "/etc/sysconfig/network-scripts/$1"
80f447
-- 
80f447
2.27.0
80f447