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

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