Blame 0121-network-net-lib.sh-ibft-unset-gateway-or-dns-if-set-.patch

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