From: Harald Hoyer Date: Tue, 18 Aug 2015 10:40:01 +0000 (+0200) Subject: network/net-lib.sh:ibft unset gateway or dns, if set to 0.0.0.0 X-Git-Tag: 044~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c04a321b92ba9c7a5e63fc07e58607025c588bed;p=thirdparty%2Fdracut.git network/net-lib.sh:ibft unset gateway or dns, if set to 0.0.0.0 (cherry picked from commit 942d60d8afad4eb8b131a33fe9618e3e8392d33f) --- diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index 2f25de742..b61a1e82c 100755 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -242,9 +242,12 @@ ibft_to_cmdline() { # skip not assigned ip adresses [ "$ip" = "0.0.0.0" ] && continue [ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a) + [ "$gateway" = "0.0.0.0" ] && unset $gateway [ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a) [ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a) + [ "$dns1" = "0.0.0.0" ] && unset $dns1 [ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a) + [ "$dns2" = "0.0.0.0" ] && unset $dns2 [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a) if [ -n "$ip" ] && [ -n "$mask" ]; then echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"