Blame SOURCES/0309-network-net-lib.sh-ibft-unset-gateway-or-dns-if-set-.patch

64b87c
From 942d60d8afad4eb8b131a33fe9618e3e8392d33f Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Tue, 18 Aug 2015 12:40:01 +0200
64b87c
Subject: [PATCH] network/net-lib.sh:ibft unset gateway or dns, if set to
64b87c
 0.0.0.0
64b87c
64b87c
---
64b87c
 modules.d/40network/net-lib.sh | 3 +++
64b87c
 1 file changed, 3 insertions(+)
64b87c
64b87c
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
64b87c
index 44c1bf0..c820356 100755
64b87c
--- a/modules.d/40network/net-lib.sh
64b87c
+++ b/modules.d/40network/net-lib.sh
64b87c
@@ -236,9 +236,12 @@ ibft_to_cmdline() {
64b87c
                 # skip not assigned ip adresses
64b87c
                 [ "$ip" = "0.0.0.0" ] && continue
64b87c
                 [ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
64b87c
+                [ "$gateway" = "0.0.0.0" ] && unset $gateway
64b87c
                 [ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
64b87c
                 [ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
64b87c
+                [ "$dns1" = "0.0.0.0" ] && unset $dns1
64b87c
                 [ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a)
64b87c
+                [ "$dns2" = "0.0.0.0" ] && unset $dns2
64b87c
                 [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
64b87c
                 if [ -n "$ip" ] && [ -n "$mask" ]; then
64b87c
                     echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"