From a0a04529360da23b1c9037105280f6b87cbc97b8 Mon Sep 17 00:00:00 2001 From: yzamir Date: Thu, 12 Sep 2024 17:33:22 +0300 Subject: [PATCH] Search for any line that include the IP not juse equals IP Signed-off-by: yzamir --- .../pkg/customize/scripts/rhel/run/network_config_util.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt-v2v/pkg/customize/scripts/rhel/run/network_config_util.sh b/virt-v2v/pkg/customize/scripts/rhel/run/network_config_util.sh index 751dcea5f..69435ea7f 100644 --- a/virt-v2v/pkg/customize/scripts/rhel/run/network_config_util.sh +++ b/virt-v2v/pkg/customize/scripts/rhel/run/network_config_util.sh @@ -110,7 +110,7 @@ udev_from_ifcfg() { fi # Find the matching network script file - IFCFG=$(grep -l "IPADDR=$S_IP" "$NETWORK_SCRIPTS_DIR"/*) + IFCFG=$(grep -l "IPADDR=.*$S_IP.*$" "$NETWORK_SCRIPTS_DIR"/*) if [ -z "$IFCFG" ]; then log "Info: no ifcg config file name foud for $S_IP." continue @@ -148,7 +148,7 @@ udev_from_nm() { fi # Find the matching NetworkManager connection file - NM_FILE=$(grep -El "address[0-9]*=$S_IP" "$NETWORK_CONNECTIONS_DIR"/*) + NM_FILE=$(grep -El "address[0-9]*=.*$S_IP.*$" "$NETWORK_CONNECTIONS_DIR"/*) if [ -z "$NM_FILE" ]; then log "Info: no nm config file name foud for $S_IP." continue