X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2F9990-netbase.sh;h=64e30df4d4fd45200b386767a4f49da5aa9446f1;hb=8775227a9da3328eb25528b24cb1392995bbe16e;hp=3f5f7aff1fe04c3c1c8159a6c3ec7be6510e154f;hpb=2e70d7be610c9e45787c37352d36241de3c155d7;p=live-boot-grml.git diff --git a/scripts/boot/9990-netbase.sh b/scripts/boot/9990-netbase.sh index 3f5f7af..64e30df 100755 --- a/scripts/boot/9990-netbase.sh +++ b/scripts/boot/9990-netbase.sh @@ -11,11 +11,12 @@ Netbase () # FIXME: stop hardcoding overloading of initramfs-tools functions . /scripts/functions - . /lib/live/boot/initramfs-tools.sh + . /lib/live/boot/9990-initramfs-tools.sh log_begin_msg "Preconfiguring networking" IFFILE="/root/etc/network/interfaces" + DNSFILE="/root/etc/resolv.conf" if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ] then @@ -43,6 +44,7 @@ EOF ifaddress="$(echo ${ifline} | cut -f2 -d ':')" ifnetmask="$(echo ${ifline} | cut -f3 -d ':')" ifgateway="$(echo ${ifline} | cut -f4 -d ':')" + nameserver="$(echo ${ifline} | cut -f5 -d ':')" cat >> "${IFFILE}" << EOF allow-hotplug ${ifname} @@ -60,6 +62,17 @@ cat >> "${IFFILE}" << EOF EOF fi + + if [ -n "${nameserver}" ] + then + if [ -e "${DNSFILE}" ] + then + grep -v ^nameserver "${DNSFILE}" > "${DNSFILE}.tmp" + mv "${DNSFILE}.tmp" "${DNSFILE}" + fi + + echo "nameserver ${nameserver}" >> "${DNSFILE}" + fi done else if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]