Skip to content

Commit

Permalink
gured from missing nm directories
Browse files Browse the repository at this point in the history
Signed-off-by: yzamir <[email protected]>
  • Loading branch information
yaacov authored and mnecas committed Aug 29, 2024
1 parent f9cb360 commit 4d3e321
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions virt-v2v/cold/scripts/rhel/run/network_config_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ extract_mac_ip() {

# Create udev rules based on the macToip mapping + ifcfg network scripts
udev_from_ifcfg() {
# Check if the network scripts directory exists
if [[ ! -d "$NETWORK_SCRIPTS_DIR" ]]; then
echo "Warning: Directory $NETWORK_SCRIPTS_DIR does not exist." >&2
return 0
fi

# Read the mapping file line by line
while IFS= read -r line; do
# Extract S_HW and S_IP
Expand All @@ -56,6 +62,12 @@ udev_from_ifcfg() {

# Create udev rules based on the macToip mapping + network manager connections
udev_from_nm() {
# Check if the network connections directory exists
if [[ ! -d "$NETWORK_CONNECTIONS_DIR" ]]; then
echo "Warning: Directory $NETWORK_CONNECTIONS_DIR does not exist." >&2
return 0
fi

# Read the mapping file line by line
while IFS= read -r line; do
# Extract S_HW and S_IP
Expand Down

0 comments on commit 4d3e321

Please sign in to comment.