diff --git a/hyper-v.changes b/hyper-v.changes index cc7d019..6db6e5f 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Nov 22 18:14:12 CET 2012 - ohering@suse.de + +- update hv_get_dhcp_info to work with our ifcfg [bnc#790469] +- remove cat usage from hv_get_dns_info +- add quoting to hv_set_ifconfig to make it more robust + ------------------------------------------------------------------- Mon Nov 12 17:18:25 CET 2012 - ohering@suse.de diff --git a/hyper-v.tools.hv.hv_get_dhcp_info.sh b/hyper-v.tools.hv.hv_get_dhcp_info.sh index 8d8fc1c..f16e8fc 100644 --- a/hyper-v.tools.hv.hv_get_dhcp_info.sh +++ b/hyper-v.tools.hv.hv_get_dhcp_info.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This example script retrieves the DHCP state of a given interface. +# This script retrieves the DHCP state of a given interface. # In the interest of keeping the KVP daemon code free of distro specific # information; the kvp daemon code invokes this external script to gather # DHCP setting for the specific interface. @@ -16,9 +16,9 @@ # this script can be based on the Network Manager APIs for retrieving DHCP # information. -if_file="/etc/sysconfig/network-scripts/ifcfg-"$1 +if_file="/etc/sysconfig/network/ifcfg-$1" -dhcp=$(grep "dhcp" $if_file 2>/dev/null) +dhcp=$(grep -- '^BOOTPROTO=.*dhcp' "$if_file" 2>/dev/null) if [ "$dhcp" != "" ]; then diff --git a/hyper-v.tools.hv.hv_get_dns_info.sh b/hyper-v.tools.hv.hv_get_dns_info.sh index c02099b..65a0045 100644 --- a/hyper-v.tools.hv.hv_get_dns_info.sh +++ b/hyper-v.tools.hv.hv_get_dns_info.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This example script parses /etc/resolv.conf to retrive DNS information. +# This script parses /etc/resolv.conf to retrive DNS information. # In the interest of keeping the KVP daemon code free of distro specific # information; the kvp daemon code invokes this external script to gather # DNS information. @@ -10,4 +10,7 @@ # this script can be based on the Network Manager APIs for retrieving DNS # entries. -cat /etc/resolv.conf 2>/dev/null | awk '/^nameserver/ { print $2 }' +if test -r /etc/resolv.conf +then + awk -- '/^nameserver/ { print $2 }' /etc/resolv.conf +fi diff --git a/hyper-v.tools.hv.hv_set_ifconfig.sh b/hyper-v.tools.hv.hv_set_ifconfig.sh index 1be68df..3860957 100644 --- a/hyper-v.tools.hv.hv_set_ifconfig.sh +++ b/hyper-v.tools.hv.hv_set_ifconfig.sh @@ -77,7 +77,7 @@ then fi echo "$0: working on network interface ifcfg-${IF_NAME}" -cp -b ${t} /etc/sysconfig/network/ifcfg-${IF_NAME} -ifdown ${IF_NAME} -o hotplug -ifup ${IF_NAME} -o hotplug +cp -b ${t} "/etc/sysconfig/network/ifcfg-${IF_NAME}" +ifdown "${IF_NAME}" -o hotplug +ifup "${IF_NAME}" -o hotplug ) 2>&1 | logger -t "${0##*/}[$PPID / $$]"