207404
From 3e912f878de8d310bd06199e03602c63d2b60dba Mon Sep 17 00:00:00 2001
207404
From: Radek Vykydal <rvykydal@redhat.com>
207404
Date: Tue, 20 Dec 2022 16:40:23 +0100
207404
Subject: [PATCH] fix(network-manager): allow running nm-run.sh multiple times
207404
207404
This partially reverts
207404
https://github.com/redhat-plumbers/dracut-rhel9/commit/77630365aed201a729c73a9ffda0733a75f3fee4
207404
207404
Anaconda needs to be able to run nm-run.sh to trigger online hooks again
207404
after kickstart is fetched from storage and network is configured
207404
accordingly.
207404
207404
rhel-only
207404
Resolves: rhbz#2157082
207404
---
207404
 modules.d/35network-manager/nm-run.sh | 9 +++++----
207404
 1 file changed, 5 insertions(+), 4 deletions(-)
207404
207404
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
207404
index 7d8d61fa..6110733d 100755
207404
--- a/modules.d/35network-manager/nm-run.sh
207404
+++ b/modules.d/35network-manager/nm-run.sh
207404
@@ -2,11 +2,12 @@
207404
 
207404
 type source_hook > /dev/null 2>&1 || . /lib/dracut-lib.sh
207404
 
207404
-if [ -e /tmp/nm.done ]; then
207404
-    return
207404
-fi
207404
-
207404
 if [ -z "$DRACUT_SYSTEMD" ]; then
207404
+
207404
+    if [ -e /tmp/nm.done ]; then
207404
+        return
207404
+    fi
207404
+
207404
     # Only start NM if networking is needed
207404
     if [ -e /run/NetworkManager/initrd/neednet ]; then
207404
         for i in /usr/lib/NetworkManager/system-connections/* \