From df043786254f57f7c46c538223dc2d916bdf4a9f2b3d6107d15ae82e05b311f6 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 23 Nov 2012 19:50:20 +0000 Subject: [PATCH] more updates - update hv_set_ifconfig further to work with our ifcfg [bnc#790469] OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=46 --- hyper-v.changes | 2 +- hyper-v.tools.hv.hv_set_ifconfig.sh | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/hyper-v.changes b/hyper-v.changes index 2e66669..1b4665e 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Fri Nov 23 15:58:28 CET 2012 - ohering@suse.de +Fri Nov 23 20:49:31 CET 2012 - ohering@suse.de - update hv_set_ifconfig further to work with our ifcfg [bnc#790469] diff --git a/hyper-v.tools.hv.hv_set_ifconfig.sh b/hyper-v.tools.hv.hv_set_ifconfig.sh index 46ef9c2..15123d1 100644 --- a/hyper-v.tools.hv.hv_set_ifconfig.sh +++ b/hyper-v.tools.hv.hv_set_ifconfig.sh @@ -122,23 +122,17 @@ fi for var in ${!IPV6ADDR*} do index=${var#IPV6ADDR} - pfx= # find corresponding IPV6NETMASK variable - eval nm=\$IPV6NETMASK${index} + eval pfx=\$IPV6NETMASK${index} # if specified, calculate prefix - if test -n "${nm}" + if test -z "${pfx}" then - pfx=`mask2pfxlen "${nm}" 2>/dev/null` + pfx=128 fi # construct actual value eval val=\$IPV6ADDR${index} - # append prefix to value - if test -n "${pfx}" - then - val="${val}/${pfx}" - fi # write config variable - echo "IPV6ADDR${index}='${val}'" + echo "IPADDR${index}='${val}/${pfx}'" done ) >> "${t_ifcfg}" @@ -177,9 +171,10 @@ done echo "$0: working on network interface ifcfg-${IF_NAME}" cp -fb ${t_ifcfg} "/etc/sysconfig/network/ifcfg-${IF_NAME}" cp -fb ${t_ifroute} "/etc/sysconfig/network/ifroute-${IF_NAME}" -if test -n "${_DNS_}" && test -w /etc/sysconfig/network/config +if test -w /etc/sysconfig/network/config then sed -i "s@^NETCONFIG_DNS_STATIC_SERVERS=.*@NETCONFIG_DNS_STATIC_SERVERS='$_DNS_'@" /etc/sysconfig/network/config + netconfig update -m dns fi ifdown "${IF_NAME}" -o hotplug ifup "${IF_NAME}" -o hotplug