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

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