X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-netbase.sh;h=bae858a76236df22caa77367fb1c56ccee8cf190;hb=27bc786ffea0c796827b628fb48fcdd755eace9d;hp=6fb79888ea13ee625275afbc55179c07e4559cbd;hpb=c9f691f2a162911d90595f904b16c4e9a7f23fc5;p=live-boot-grml.git diff --git a/components/9990-netbase.sh b/components/9990-netbase.sh index 6fb7988..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,9 +63,24 @@ 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}" ] + if [ -n "${NODHCP}" ] + then + # force DHCP off + method="manual" + elif [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ] then # default, dhcp assigned method="dhcp" @@ -81,7 +93,7 @@ EOF # iterate the physical interfaces and add them to the interfaces list and also add when ethdevice= called on cmdline if [ "${method}" != dhcp ] || ([ ! -x /root/usr/sbin/NetworkManager ] && [ ! -x /root/usr/sbin/wicd ]) || [ ! -z "${ETHDEVICE}" ] then - for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan* + for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan* /sys/class/net/en* do [ -e ${interface} ] || continue i="$(basename ${interface})"