projects
/
live-boot-grml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update changelog for release 3.0~b10-1+grml.1
[live-boot-grml.git]
/
scripts
/
boot
/
9990-netbase.sh
diff --git
a/scripts/boot/9990-netbase.sh
b/scripts/boot/9990-netbase.sh
index
3f5f7af
..
64e30df
100755
(executable)
--- 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
# 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"
log_begin_msg "Preconfiguring networking"
IFFILE="/root/etc/network/interfaces"
+ DNSFILE="/root/etc/resolv.conf"
if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ]
then
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 ':')"
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}
cat >> "${IFFILE}" << EOF
allow-hotplug ${ifname}
@@
-60,6
+62,17
@@
cat >> "${IFFILE}" << EOF
EOF
fi
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}" ]
done
else
if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]