projects
/
live-boot-grml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support debian_networking boot option to use Debian's network behavior
[live-boot-grml.git]
/
components
/
9990-netbase.sh
diff --git
a/components/9990-netbase.sh
b/components/9990-netbase.sh
index
df8d080
..
bae858a
100755
(executable)
--- a/
components/9990-netbase.sh
+++ b/
components/9990-netbase.sh
@@
-9,10
+9,6
@@
Netbase ()
return
fi
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"
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 ':')"
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}
@@
-66,9
+63,24
@@
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
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"
then
# default, dhcp assigned
method="dhcp"