X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-netbase.sh;h=bae858a76236df22caa77367fb1c56ccee8cf190;hb=27bc786ffea0c796827b628fb48fcdd755eace9d;hp=c463cc0768cadb4ec943dc476b643b79b842f5e0;hpb=e6f399c69f13300dd83949266d4ab6161768faa5;p=live-boot-grml.git diff --git a/components/9990-netbase.sh b/components/9990-netbase.sh index c463cc0..bae858a 100755 --- a/components/9990-netbase.sh +++ b/components/9990-netbase.sh @@ -9,10 +9,6 @@ Netbase () return fi - # FIXME: stop hardcoding overloading of initramfs-tools functions - . /scripts/functions - . /lib/live/boot/9990-initramfs-tools.sh - log_begin_msg "Preconfiguring networking" IFFILE="/root/etc/network/interfaces" @@ -49,6 +45,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} @@ -66,6 +63,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 [ -n "${NODHCP}" ]