Skip to content

Commit

Permalink
Adding support for nameserver in ip= boot parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenshiau authored and daniel-baumann committed Aug 14, 2012
1 parent 6f81ca9 commit ab6364d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/boot/9990-netbase.sh
Expand Up @@ -16,6 +16,7 @@ Netbase ()
log_begin_msg "Preconfiguring networking"

IFFILE="/root/etc/network/interfaces"
DNSFILE="/root/etc/resolv.conf"

if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ]
then
Expand Down Expand Up @@ -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}
Expand All @@ -57,6 +59,15 @@ EOF
cat >> "${IFFILE}" << EOF
gateway ${ifgateway}
EOF

fi

if [ -n "${nameserver}" ]
then

cat >> "${DNSFILE}" << EOF
nameserver ${nameserver}
EOF

fi
Expand Down

0 comments on commit ab6364d

Please sign in to comment.